Add Windows Service manually to Nagios using WMI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jimhoffmann
Posts: 50
Joined: Fri May 03, 2013 1:38 pm

Add Windows Service manually to Nagios using WMI

Post by jimhoffmann »

Running the Windows WMI Wizard and when I add a Windows 2012 R2 host and it scans the Windows services on the server, it does not find all of them. So I would like to know how to resolve this or how to manually add a Windows service to Nagios?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Add Windows Service manually to Nagios using WMI

Post by mcapra »

If you're using the latest version of Nagios XI and the Windows WMI wizard, there should be a field you can bump up to increase the number of services listed:
2017_01_19_12_23_55_Configuration_Nagios_XI.png
Try bumping that value up to 65536 and see if it now includes the service you're trying to monitor.
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
jimhoffmann
Posts: 50
Joined: Fri May 03, 2013 1:38 pm

Re: Add Windows Service manually to Nagios using WMI

Post by jimhoffmann »

That did not work. It looks as if the services it is picking up are the ones that are part of svchost.exe, but not the ones I want to monitor. I have an application that I have installed with services I want to monitor and was hoping to be able to do that through Nagios.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Add Windows Service manually to Nagios using WMI

Post by mcapra »

Some services cannot be monitored by WMI. If this is the case, you're probably going to need to leverage an agent of some sort (such as NSClient++).

From your Nagios XI machine, can you share the output of the command (it'll be pretty long, perhaps send it to a file), replacing the <> bits with ones specific to your environment (feel free to exclude them from your public post, I just need the command's output):

Code: Select all

/usr/local/nagios/libexec/check_wmi_plus.pl -H <host> -u <win_username> -p <win_password> -m checkservice -a '<service_name>' -c _Total=1: -c 0 -d
Keeping in mind that the service name is different from the display name:
2017_01_19_12_38_03_192.168.67.99_Remote_Desktop_Connection.png
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
jimhoffmann
Posts: 50
Joined: Fri May 03, 2013 1:38 pm

Re: Add Windows Service manually to Nagios using WMI

Post by jimhoffmann »

$ /usr/local/nagios/libexec/check_wmi_plus.pl -H <host> -u '<username>' -p '<password>' -m checkservice -a 'Adlib Process Manager' -c _Total=1: -c 0
CRITICAL - [Triggered by _Total<1] - Found 0 Services(s), 0 OK and 0 with problems (0 excluded). |&apos;Total Service Count&apos;=0;1; &apos;Service Count OK State&apos;=0; &apos;Service Count Problem State&apos;=0;0; &apos;Excluded Service Count&apos;=0;

Above is the output I get when I run the Check Command.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Add Windows Service manually to Nagios using WMI

Post by tmcdonald »

Can you run what @mcapra suggested from the command line as opposed to from within the web interface? The web interface sometimes has issues with escaping or permissions.
Former Nagios employee
jimhoffmann
Posts: 50
Joined: Fri May 03, 2013 1:38 pm

Re: Add Windows Service manually to Nagios using WMI

Post by jimhoffmann »

You can close this ticket. I installed a NCPA agent on a test server and found it easier to monitor servers that way.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Add Windows Service manually to Nagios using WMI

Post by mcapra »

Sure thing, feel free to open a new thread if you have NCPA specific questions!
Former Nagios employee
https://www.mcapra.com/
Locked