Windows WMI CPU Usage monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ibukingolts
Posts: 5
Joined: Wed May 09, 2012 9:46 am

Windows WMI CPU Usage monitoring

Post by ibukingolts »

Nagios XI
1. Redhat 5
2. 64bit
3. Manual Install
4. SSL yes, otherwise no other special configuration

Hi.
I setup WMI on couple Windows servers and the main problem is with monitoring CPU Usage.
I am using latest WMI package abailable for download 1.49.

On Windows 2003 server (physical or VM) it show in Status Information:
UNKNOWN - The WMI query had problems. The target host (xxx.xxx.xxx.xxx) might not have the required WMI classes installed. This can happen, for example, if you are trying to checkiis but IIS is not installed. It can also happen if your version of Windows doe
On Windows 2008 server (physical or VM) it show in Status Information:
OK (Sample Period 900 sec) - Average CPU Utilisation Need at least 2 WMI samples%
But on Performance Graphs page:
No performance graphs were found for this service.
jopsahl
Posts: 4
Joined: Wed Apr 04, 2012 11:44 am

Re: Windows WMI CPU Usage monitoring

Post by jopsahl »

Are you using Check WMI Plus on the system?

If so you will need to run this command twice for CPU monitoring to properly work.
# check_wmi_plus.pl -H HOST -m checkcpu -u USER -p PASS

The full installation and configuration guides for monitoring WMI with XI can be found on our Library website.
http://assets.nagios.com/downloads/nagi ... ng_WMI.pdf
http://assets.nagios.com/downloads/nagi ... For_XI.pdf
ibukingolts
Posts: 5
Joined: Wed May 09, 2012 9:46 am

Re: Windows WMI CPU Usage monitoring

Post by ibukingolts »

Yes, I use Check_wmi_plus

# check_wmi_plus.pl -H HOSTADDRESS -u USER -p PASS -m checkcpu -w '80' -c '90'
jopsahl
Posts: 4
Joined: Wed Apr 04, 2012 11:44 am

Re: Windows WMI CPU Usage monitoring

Post by jopsahl »

You will need to run that command twice for each host to get the samples.

A new version of Check WMI Plus was also recently released (1.52).
http://www.edcint.co.nz/checkwmiplus/?q=Change%20Log
ibukingolts
Posts: 5
Joined: Wed May 09, 2012 9:46 am

Re: Windows WMI CPU Usage monitoring

Post by ibukingolts »

This command are set to run with check interval - so it should get more samples.

But graphs is my second concern here,

On Windows 2003 server (physical or VM) it show in Status Information:

UNKNOWN - The WMI query had problems. The target host (xxx.xxx.xxx.xxx) might not have the required WMI classes installed. This can happen, for example, if you are trying to checkiis but IIS is not installed. It can also happen if your version of Windows doe

I run this command from Nagios server:
[nagios@nagiosxi0 libexec]$ ./check_wmi_plus.pl -H xxx.xxx.xxx.xxx -u 'domain/user' -p 'password-' -m checkcpu -w '80' -c '90'
UNKNOWN - The WMI query had problems. The target host (xxx.xxx.xxx.xxx) might not have the required WMI classes installed. This can happen, for example, if you are trying to checkiis but IIS is not installed. It can also happen if your version of Windows does not support this check (this might be because the WMI fields are named differently in different Windows versions). Sometimes, some systems 'lose' WMI Classes and you might need to rebuild your WMI repository. Other causes include mistyping the WMI namesspace/class/fieldnames. There may be other causes as well. You can use wmic from the command line to troubleshoot. Wmic error text on the next line.
[wmi/wmic.c:212:main()] ERROR: Retrieve result data.
NTSTATUS: NT code 0x80041003 - NT code 0x80041003
jopsahl
Posts: 4
Joined: Wed Apr 04, 2012 11:44 am

Re: Windows WMI CPU Usage monitoring

Post by jopsahl »

Are you only getting the error when running a cpu check, or do all checks in wmic give you the same error?
[wmi/wmic.c:212:main()] ERROR: Retrieve result data.
NTSTATUS: NT code 0x80041003 - NT code 0x80041003
The error codes indicate that the login credentials are incorrect or that the permissions have not been set.

On the host make sure that the user has both Enable Account and Remote Enable selected.
http://technet.microsoft.com/en-us/libr ... 87533.aspx
ibukingolts
Posts: 5
Joined: Wed May 09, 2012 9:46 am

Re: Windows WMI CPU Usage monitoring

Post by ibukingolts »

I am only getting the error when running a cpu check on Windows 2003 servers. All other checks in wmic are working fine and also provide graphs.

I verified the wmimgmt.msc permissions on all servers (Windows 2003 and 2008) and they are all set as it has been set in the manual.
There is no issues with firewall - it is disabled.
jopsahl
Posts: 4
Joined: Wed Apr 04, 2012 11:44 am

Re: Windows WMI CPU Usage monitoring

Post by jopsahl »

Are the Server 2003 installs identical or installed off of the same image?

I'm wondering if WMI is corrupted. You can run the Microsoft WMI diagnostics tool and see if it comes back with any errors. I've seen it where it will run 90% of the checks just fine but others will report errors.
http://www.microsoft.com/en-us/download ... px?id=7684

You can also use the WMI tester built into windows to check the machine remotely.
Start> Run> wbemtest.exe
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Windows WMI CPU Usage monitoring

Post by scottwilkerson »

Also, it is quite possible that the wmi query is different on 2003 servers than the rest. It would maybe be best to contact the plugin creator to see if they are aware of any oddities with checkcpu and 2003
http://www.edcint.co.nz/checkwmiplus/?q=node/25
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: Windows WMI CPU Usage monitoring

Post by yancy »

Looking at the error, it looks like there's an issue possibly with WMIC which wmi_plus uses under the hood.

give this a shot

Code: Select all

/usr/local/bin/wmic -V
if WMIC is installed and has a valid version, try running a query using wmic to test

Code: Select all

/usr/local/bin/wmic //ipaddress "select * from Win32_ComputerSystem"
Locked