Posts

Showing posts from May, 2018

Perf counter alert shows sample count instead of sampled value

I made a unit monitor to alert when the  Hyper-V Hypervisor Logical Processor \ % Total Run Time  counter exceeded a certain threshold. I used the  System.Performance.ConsecutiveSamplesThreshold unit monitor type and noticed that when it alerted the alert parameter for  $Data[Default='']/Context/Value$ was showing the number of samples instead of the threshold value that was sampled. Oddly, the  $Data[Default='']/Context/Value$ value in System.Performance.ThresholdMonitorType works correctly. Alert description example: Hyper-V server %hostname% is using too much CPU. Counter: Hyper-V Hypervisor Logical Processor \ % Total Run Time Value: 2 << this is the sample number, not the sampled value. To fix this use $Data[Default='']/Context/ SampleValue $ instead. Refer to this article for more: http://www.systemcentercentral.com/system-performance-consecutivesamplesthreshold-monitor-gives-a-wrong-alert-description/

VScript

XML Query XML file Link Link Set xmlDoc = CreateObject("Microsoft.XMLDOM") xmlDoc.Async = "False" xmlDoc.Load("C:\temp\OpsMgrConnector.Config.xml") Set colNodes = xmlDoc.selectNodes ("/Message/State/Parents/Added/Item/(AuthenticationName | IsPrimary)") For Each objNode in colNodes    Wscript.Echo objNode.Text Next