Page 1 of 1

Monitoring Windows Using WMI

Posted: Wed Jul 22, 2015 1:36 am
by tthomas
Hello,

I am trying to monitor a windows machine using WMI, but it is giving the following error.

Code: Select all

# /usr/local/nagios/libexec/check_wmi_plus.pl -H HOSTNAME1 -u 'USERNAME' -p PASSWORD -m checkcpu -w _AvgCPU=90 -c _AvgCPU=95
UNKNOWN - Plugin Timed out (15 sec). There are multiple possible reasons for this, some of them include - The host  might just be really busy, it might not even be running Windows.
I did make sure that the procedure mentioned in the following document has been followed.

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Port 135 is open for the server. Does it require port 3389 to be opened for this?

It is working for another server

Code: Select all

 #/usr/local/nagios/libexec/check_wmi_plus.pl -H HOSTNAME2 -u 'USERNAME' -p PASSWORD -m checkcpu -w _AvgCPU=95 -c _AvgCPU=99
OK (Sample Period 82 sec) - Average CPU Utilisation 3.24%|'Avg CPU Utilisation'=3.24%;95;99;
So I suspect there is nothing wrong with Nagios XI.

Could you please help me here.

Regards
Tino

Re: Monitoring Windows Using WMI

Posted: Wed Jul 22, 2015 9:39 am
by jdalrymple
From the nagios server:

Code: Select all

[jdalrymple@localhost ~]$ nmap <windows IP> -p 135

Starting Nmap 5.51 ( http://nmap.org ) at 2015-07-22 09:37 CDT
Nmap scan report for <windows IP>
Host is up (0.0017s latency).
PORT    STATE SERVICE
135/tcp open  msrpc

Nmap done: 1 IP address (1 host up) scanned in 1.26 seconds
On the Windows box:

Code: Select all

C:\Users\jdalrymple>sc query winmgmt

SERVICE_NAME: winmgmt
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

Re: Monitoring Windows Using WMI

Posted: Wed Jul 22, 2015 10:44 am
by tthomas
Thanks jdalrymple for the reply.

But as I mentioned earlier we can connect to port 135 windows machine from Nagios XI server.
Also winmgmt service is in running state on windows machine.

Regards
Tino

Re: Monitoring Windows Using WMI

Posted: Wed Jul 22, 2015 10:53 am
by jdalrymple
These are the first diagnostic steps. Seeing the output of those commands give us a baseline to work from. It allows us to reference commands we might ask for later and cross reference things. We often times spot really silly problems like mismatched IP addresses or syntax errors in your check command. It's a process though, and the first part of the process is for you to illustrate for us how you would run the commands I shared earlier and also show us the exact output of those commands.

It's not that we don't believe you, sometimes these threads become pages and pages long though and having certain things like the exact input and output of nmap documented end up being the key to helping us find what's wrong with your setup.

We strive to offer good support, but can only do so if our customers and users meet us half way.

With all that said, let me offer the most useful advice I can based upon the information I have.
tthomas wrote:

Code: Select all

UNKNOWN - Plugin Timed out (15 sec). There are multiple possible reasons for this, some of them include - The host  might just be really busy, it might not even be running Windows.
This error is usually indicative of Nagios's inability to contact the WMI agent service. This is typically caused by a network misconfiguration or the service isn't responding for one reason or another.