Page 1 of 2

Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 9:55 am
by clombardo
We have a new server with a clean CentOS 7 install and a clean Nagios Core install which comes with check_wmi_plus packaged in.

We are trying to get this to work to read my Windows 8.1 machine. It seems that my windows machine is blocking WMI.

Here is what I get when I have my Windows machine firewall on:

Code: Select all

[root@livm51 plugins]# ./check_wmi_plus.pl -H xxx.xxx.xxx.xxx -m checkdrivesize -u username -p pwd
UNKNOWN - Plugin Timed out (15 sec). There are multiple possible reasons for this, some of them include - The host 192.168.19.154 might just be really busy, it might not even be running Windows.
Here is what I get when I turn OFF my Windows machine firewall:

Code: Select all

[root@livm51 plugins]# ./check_wmi_plus.pl -H xxx.xxx.xxx.xxx -m checkdrivesize -u username -p pwd
UNKNOWN - The WMI query had problems. You might have your username/password wrong or the user's access level is too low. Wmic error text on the next line.
[wmi/wmic.c:196:main()] ERROR: Login to remote object.
NTSTATUS: NT_STATUS_ACCESS_DENIED - Access denied
What do we have to configure to get this working?

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 10:17 am
by jdalrymple
Have you followed the instructions in this doc?

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 12:10 pm
by clombardo
We are using Nagios Core NOT Nagios XI. Will these instructions work for Nagios Core?

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 12:23 pm
by clombardo
In following these instructions I am getting "Access is denied" error when trying to create a wmi user. See screen shot attached.

What would I have to do to get pass this error?

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 12:52 pm
by jdalrymple
To answer your first question - yes the instructions are the same for Core and XI
To answer your second question/issue - I suspect you're not running your command prompt as administrator. You must be an admin to create local users on the Windows host.

right-click - run as administrator.

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 1:27 pm
by clombardo
Thank you.

Now I am at the end setting up the Windows Firewall. I have a Windows 8.1 machine I was trying to follow Windows XP instructions but its not the same on Windows 8.1

I went to this window (shown attached screen shot) of the Windows 8.1 firewall settings. Is this the same as opening Port 135?

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 1:30 pm
by jdalrymple
That looks proper. Try it and if it still doesn't work reference Microsoft's instructions on the process:
https://msdn.microsoft.com/en-us/librar ... 82%29.aspx

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 2:16 pm
by clombardo
I am following Microsoft link you gave me and I ran into an issue with the command:

Code: Select all

netsh advfirewall
See attached screen shot.

I am running cmd as administrator.

What must I do to get this command to work?

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 2:32 pm
by jdalrymple
Sad that Microsoft doesn't even document their own syntax properly :(

Try this:

Code: Select all

netsh firewall set service RemoteAdmin enable

Re: Check WMI Seems Blocked

Posted: Thu Mar 05, 2015 3:37 pm
by clombardo
Okay now wmi works! :mrgreen:

Code: Select all

[root@livm51 plugins]# ./check_wmi_plus.pl -H xxx.xxx.xxx.xxx -m checkcpu -u username -p pwd
Collecting first WMI sample because the previous state data file (/usr/tmp/cwpss_checkcpu__19216819154___.state) contained no data. Results will be shown the next time the plugin runs.
[root@livm51 plugins]# 
[root@livm51 plugins]# ./check_wmi_plus.pl -H xxx.xxx.xxx.xxx -m checkcpu -u username -p pwd
OK (Sample Period 17 sec) - Average CPU Utilisation 5.59%|'Avg CPU Utilisation'=5.59%; 
[root@livm51 plugins]#
Funny thing the Windows "advfirewall" commands works after I used your "firewall" command see screen shot attached.

Thank you for your AWESOME help jdalrymple! You were really amazing in how fast you responded to all my questions! Thank you very much! :D