Forum Discussion
And how about for WMI?
There's a module called WMI Troubleshooter. All it runs is this:
/*******************************************************************************
* © 2007-2024 - LogicMonitor, Inc. All rights reserved.
******************************************************************************/
import com.santaba.agent.groovyapi.win32.WMI
def hostName = hostProps.get("system.hostname")
try {
WMI.queryFirst(hostName, "select version from Win32_OperatingSystem", 60)
}
catch (IOException e) {
return 1
}
catch (Exception e)
{
// Not an IOException. Print the exception to stderr and exit non-zero
e.printStackTrace
return 3
}
return 0
If it returns anything other than a 0, it alerts. However, I have a couple machines returning a 0 but CPU and Uptime are both No Data which means WMI is definitely not working properly.
We just don't like the Uptime alert because everyone has been trained to ignore those because they alert any time a machine was rebooted in the last hour. We want to have a check with a name that actually tells you something is wrong.
Maybe I'll try a Powershell command or something.
The issue with WMI is there is a difference between a straight WMI call like your select version from Win32 and a CIM2 call.
The UAC troubleshooter module might get you in the right direction to combine datapoints.
I would reccomend just tracking what comes back and add that into a larger check. Does uptime return something, does os return something does X y or Z return something, then alert.
Related Content
- 6 months ago
- 2 years agoAnonymous