Network.usage min and max requires statistics level 4, and since you want to go back 30 days, that would mean for Historical Interval 3.
The other limitation is that if you want to have a number per vnic you would also need Statistics Level 3.
Try something like this
$stat = 'net.usage.average'
$start = (Get-Date).AddDays(-30)
$esx = Get-VMHost
Get-Stat -Entity $esx -Start $start -Stat $stat |
Group-Object -Property {$_.Entity.Name} |
Select @{N='ESX';E={$_.Name}},
@{N='NetAvg%';E={
$average = $_.Group | where{$_.Instance -eq ''} |
Measure-Object -Property Value -Average | Select -ExpandProperty Average
$pnicInUse = @()
$pnicInUse += ($_.Group[0].Entity.ExtensionData.Config.Network.ProxySwitch | %{
$_.Pnic
})
$pnicInUse += ($_.Group[0].Entity.ExtensionData.Config.Network.Vswitch | %{
$_.Pnic
})
$bitRateSec = $_.Group[0].Entity.ExtensionData.Config.Network.Pnic |
where{$pnicInUse -contains $_.Key} | %{$_.LinkSpeed.SpeedMb} |
Measure-Object -Sum | Select -ExpandProperty Sum
"{0:p4}" -f ($average/($BitRateSec * 8KB))
}}
The script will determine for each ESXi nodes that active pNICs, and calculate the cumulative network speed (in Mbps).
From the statistics it gets the average network usage for the ESXi node (in KBps).
Then it is a matter of converting and expressing as a percentage.