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

Re: Monitor packet drops across all ESXi hosts

$
0
0

I would propose to get the counters directly from the ESXi servers, then you don't need to bother about statistics levels.

 

Something like this would show for each vmnic on an ESXi how many packets were dropped (send & receive) during the interval (which is 20 seconds for Realtime).

 

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

 

The script looks at the last 2 minutes.


Viewing all articles
Browse latest Browse all 244595

Trending Articles



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