VMware Cloud Community
E4F
Contributor
Contributor

Get-Stat Network Average Question

Is it possible to get the network average for each ESX host in vCenter?  Something like this

ServerName     xx%

All that I have found is the following which is not what I want and too much data.

get-vmhost | get-stat -network -Start (Get-Date).AddDays(-1)

Any help would be much appreciated.

Tags (1)
0 Kudos
5 Replies
E4F
Contributor
Contributor

or just

ServerName     Usage

0 Kudos
LucD
Leadership
Leadership

You would need to get the net.usage.average metric for that.

Note that the metric returns values in KBps, to get a percentage you will need to obtain the maximum throughput capacity.

I don't think the aggregation function works correctly for net metrics.

You would have to retrieve the individual vmnic instances and calculate the average yourself.

Do you really want an average over all vmnics ?

And which time period are looking at ? 1 day ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

E4F
Contributor
Contributor

I am really looking for the top network users with clean output.

0 Kudos
LucD
Leadership
Leadership

Do you mean ESX(i) servers or guests ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
E4F
Contributor
Contributor

I got it working

Get-VMHost | Select Name, @{
N="Net Avg Mbps";E={[Math]::Round((($_ | Get-Stat -Stat net.usage.average -Start (Get-Date).AddDays(-1) | Measure-Object Value -Average).Average) / 1024, 2)}} | Sort Name | FT

0 Kudos