Page 1 of 1

User NRPE to monitor multiple Windows Server Services

Posted: Tue Aug 26, 2014 10:56 pm
by bryceee
nsclient.ini
(21.37 KiB) Downloaded 562 times
We are currently running Ubuntu 14.04 and Nagios 4.0.7 with NSClient++

Is there away to monitor multiple windows services in one rule
I want to to be able to use a check_command like check_win2012_services to monitor 5+ services.

Currently I can only get them to work one by one like so, this is defined in the host file(Server) on Nagios
#Define a service to Check a Windows Service
define service{
use windows-server-service
host_name PERSPLUNK01
service_description Splunkd Service
check_command check_win2012_service!Splunkd
}
define service{
use windows-server-service
host_name PERSPLUNK01
service_description SplunkWeb Service
check_command check_win2012_service!splunkweb
}

The command I am using looks like this
# CheckService
define command{
command_name check_win2012_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a ShowAll "$ARG1$"
}

I know it was possible when we used check_nt.

Do I need to do something on the remote hosts site (where NSclient++) is installed
I appreciate the assitance, been hitting a brick wall on this.

Bryce

Re: User NRPE to monitor multiple Windows Server Services

Posted: Wed Aug 27, 2014 12:16 pm
by slansing
I don't see a "CheckServiceState" defined anywhere in there for NRPE commands, I believe that is the check_nt module call used for services. If you are trying to check them with NRPE you will need to provide a plugin which has the capability of doing this, which I have not been able to find whilst looking around. You may need to write your own based off someone elses, which we can help with a bit.

Re: User NRPE to monitor multiple Windows Server Services

Posted: Thu Aug 28, 2014 3:46 am
by bryceee
okay I have managed to get the 6 services I need to monitor in one rule.
I had to use 6 arguments

The command file looks like so
# Check Windows 2012 Services
define command{
command_name check_win2012__service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckServiceState -a ShowAll=long "$ARG1$" "$ARG2$" "$ARG3$" "$ARG4$" "$ARG5$" $ARG6$"

And on in the Server I defined it looks like so
#Define a service to "Check Windows Services"
define service{
use windows-server-service
host_name PERSPLUNK01
service_description Windows 2012 Server Services
check_command check_win2012_service!DNS Client!Netlogon!Remote Procedure Call (RPC)!Remote Desktop Services!Remote Desktop Configuration
}

Re: User NRPE to monitor multiple Windows Server Services

Posted: Thu Aug 28, 2014 12:07 pm
by slansing
Looks good, are the checks coming in properly?

Re: User NRPE to monitor multiple Windows Server Services

Posted: Thu Aug 28, 2014 7:11 pm
by bryceee
Yeah it actually is working, don't mean to sound so surprised. I am just new to this.
Tested it by turning services on and off at random and it flags it.

Re: User NRPE to monitor multiple Windows Server Services

Posted: Fri Aug 29, 2014 9:42 am
by tmcdonald
Sounds great! I'll be closing this thread now, but feel free to open another if you need anything in the future!