Check WMI Seems Blocked

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
clombardo
Posts: 41
Joined: Thu Mar 06, 2014 12:36 pm

Check WMI Seems Blocked

Post 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?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Check WMI Seems Blocked

Post by jdalrymple »

Have you followed the instructions in this doc?

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
clombardo
Posts: 41
Joined: Thu Mar 06, 2014 12:36 pm

Re: Check WMI Seems Blocked

Post by clombardo »

We are using Nagios Core NOT Nagios XI. Will these instructions work for Nagios Core?
clombardo
Posts: 41
Joined: Thu Mar 06, 2014 12:36 pm

Re: Check WMI Seems Blocked

Post 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?
Attachments
wmiuser_edit.jpg
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Check WMI Seems Blocked

Post 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.
clombardo
Posts: 41
Joined: Thu Mar 06, 2014 12:36 pm

Re: Check WMI Seems Blocked

Post 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?
Attachments
windowsfirewall_edit.jpg
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Check WMI Seems Blocked

Post 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
clombardo
Posts: 41
Joined: Thu Mar 06, 2014 12:36 pm

Re: Check WMI Seems Blocked

Post 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?
Attachments
wmiwindowscmd_edit.jpg
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Check WMI Seems Blocked

Post by jdalrymple »

Sad that Microsoft doesn't even document their own syntax properly :(

Try this:

Code: Select all

netsh firewall set service RemoteAdmin enable
clombardo
Posts: 41
Joined: Thu Mar 06, 2014 12:36 pm

Re: Check WMI Seems Blocked

Post 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
Attachments
windowswmiworks_edit.jpg
Locked