User NRPE to monitor multiple Windows Server Services
User NRPE to monitor multiple Windows Server Services
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
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: User NRPE to monitor multiple Windows Server Services
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
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
}
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
}
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: User NRPE to monitor multiple Windows Server Services
Looks good, are the checks coming in properly?
Re: User NRPE to monitor multiple Windows Server Services
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.
Tested it by turning services on and off at random and it flags it.
Re: User NRPE to monitor multiple Windows Server Services
Sounds great! I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee