Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 247559

Re: Monitor packet drops across all ESXi hosts

$
0
0

That is quite easy actually, just add the hostname as an extra property on the Grou-Object cmdlet.

Something like this

 

$start= (Get-Date).AddMinutes(-2)$metrics="net.droppedRx.summation","net.droppedTx.summation"$esx=Get-VMHost
Get-Stat
-Entity$esx-Stat$metrics-Realtime-Start$start|where {$_.Instance-ne""} |Group-Object-Property {$_.Entity.Name,$_.Instance} |%{    $ordered=$_.Group|Sort-Object-PropertyTimestamp,MetricId
    for($i=2;$i-lt$ordered.Count;$i=$i+2){        $droppedRx=$ordered[$i].Value-$ordered[$i-2].Value
        $droppedTx=$ordered[$i+1].Value-$ordered[$i-1].Value
        if($droppedRx-ne0-and$droppedTx-ne0){            New-ObjectPSObject-Property@{                VMHost=$ordered[$i].Entity.Name
               
VmNic=$ordered[$i].Instance
                "Receive Dropped Packets"=$droppedRx
               
"Transmit Dropped Packets"=$droppedTx
               
Timestamp=$ordered[$i].Timestamp
               
"Interval (seconds)"=$ordered[$i].IntervalSecs
            }        }    } }
|ft-AutoSize

Viewing all articles
Browse latest Browse all 247559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>