User NRPE to monitor multiple Windows Server Services

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.
Locked
bryceee
Posts: 33
Joined: Mon Aug 11, 2014 8:27 pm
Location: Perth, Australia

User NRPE to monitor multiple Windows Server Services

Post by bryceee »

nsclient.ini
(21.37 KiB) Downloaded 502 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
slansing
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

Post 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.
bryceee
Posts: 33
Joined: Mon Aug 11, 2014 8:27 pm
Location: Perth, Australia

Re: User NRPE to monitor multiple Windows Server Services

Post 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
}
slansing
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

Post by slansing »

Looks good, are the checks coming in properly?
bryceee
Posts: 33
Joined: Mon Aug 11, 2014 8:27 pm
Location: Perth, Australia

Re: User NRPE to monitor multiple Windows Server Services

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: User NRPE to monitor multiple Windows Server Services

Post by tmcdonald »

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
Locked