Add Windows Service manually to Nagios using WMI
-
jimhoffmann
- Posts: 50
- Joined: Fri May 03, 2013 1:38 pm
Add Windows Service manually to Nagios using WMI
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?
Re: Add Windows Service manually to Nagios using WMI
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:
Try bumping that value up to 65536 and see if it now includes the service you're trying to monitor.
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/
https://www.mcapra.com/
-
jimhoffmann
- Posts: 50
- Joined: Fri May 03, 2013 1:38 pm
Re: Add Windows Service manually to Nagios using WMI
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.
Re: Add Windows Service manually to Nagios using WMI
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):
Keeping in mind that the service name is different from the display name:
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 -dYou do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
jimhoffmann
- Posts: 50
- Joined: Fri May 03, 2013 1:38 pm
Re: Add Windows Service manually to Nagios using WMI
$ /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). |'Total Service Count'=0;1; 'Service Count OK State'=0; 'Service Count Problem State'=0;0; 'Excluded Service Count'=0;
Above is the output I get when I run the Check Command.
CRITICAL - [Triggered by _Total<1] - Found 0 Services(s), 0 OK and 0 with problems (0 excluded). |'Total Service Count'=0;1; 'Service Count OK State'=0; 'Service Count Problem State'=0;0; 'Excluded Service Count'=0;
Above is the output I get when I run the Check Command.
Re: Add Windows Service manually to Nagios using WMI
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
You can close this ticket. I installed a NCPA agent on a test server and found it easier to monitor servers that way.
Re: Add Windows Service manually to Nagios using WMI
Sure thing, feel free to open a new thread if you have NCPA specific questions!
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/