Service check either or

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Service check either or

Post by jkinning »

Running Nagios XI 2014R2.6 and monitoring SLES 11sp3 server for SSH. On majority of our servers we are leveraging Centrify SSH which I am using the check_nrpe command - $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$ with ARG1 = check_init_service and ARG2 = -a 'centrify-sshd' is there a way to have this check monitor for centrify-sshd OR sshd? I have this service check assigned to a service template since majority of my machines are running centrify-sshd but would like to either have this check for either of the sshd services or allow me to exclude the few I have that aren't running Centrify SSH and using the stock SSH.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Service check either or

Post by jdalrymple »

What you want to do isn't really possible without some amount of customization. The simplest thing to do (assuming in "either or" case the SSHD is listening on the same port) you can just use the check_ssh plugin and exclude checking the daemon using NRPE. Is this not an option?
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Service check either or

Post by jkinning »

They all are listening on port 22. So I can use that method and never thought about it like that.

Although I have some machines that sit in our DMZ which the Firewall guys have port 5666 open so I can't check. Can the check_nrpe check for this information or execute the check_ssh locally and return the information on port 5666?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Service check either or

Post by jdalrymple »

You got it...

nrpe.cfg on dmzhost:

Code: Select all

command[check_local_ssh]=/usr/local/nagios/libexec/check_ssh -H localhost

Code: Select all

[jdalrymple@nagios libexec]$ ./check_nrpe -H dmzhost -c check_local_ssh
SSH OK - OpenSSH_5.3 (protocol 2.0) | time=0.002912s;;;0.000000;10.000000
In this example I used dmzhost, but of course you could do this for any host in which you can talk to NRPE.
Locked