« Back to Microsoft Discussions

PowerTool: How to reset all vNICs stats at one time?

Combination View Flat View Tree View
Threads [ Previous | Next ]
I am trying to collect all vNICs stats and would like to rest Average, Max, Min and Delta first.
What method should I use to clear those counters?


Thanks in advance!

Tsu-Sheng,


We do not have a custom cmdlet to do this and plan to introduce one shortly. Meanwhile, you can try the following workaround:

Function ClearStats()
{
param(
[parameter(Mandatory=${true})][Cisco.Ucs.ManagedObject]${mo}
)

$dn = New-Object "Cisco.Ucs.Dn"
$dn.Value = $mo.Dn;

$dnSet = New-Object "Cisco.Ucs.DnSet"
$dnSet.AddChild($dn);

[Cisco.Ucs.MethodFactory]::StatsClearInterval($mo.GetHandle(), $dnSet, $null)
}


Sample Usage:
Get-UcsEtherTxStats | % { ClearStats $_ }


Essentially, you need to pass the statistics object in which *Max,*Min,*Avg values need to be cleared to the ClearStats function.

Thanks,
- bhaskar

Bhaskar, thanks.
I will try that.

Hi
We have a monitoring tool that queries UCS error and pause stats, and records them as a heat map. It uses the "Value" field as opposed to Avg, Min, and Max because we want to see anything that has a history of faults over time. "Delta" values do not persist for long enough. However, once the underlying cause for a fault has been resolved, the tool still reports faults becuase it reads the "Value" field (for e.g. Error stats - Fcs errors). Is there a way to reset the "Value" field as opposed to Avg, Max, Min and Delta?
Many thanks
Justin