Nest check_by_ssh in Nagios

nagios

I'm trying to monitor a remote cluster of servers with one server that has a public IP. I'm trying to nest check_by_ssh to check on things like load, etc. But no matter what kind of quoting and escaping I do, I can't seem to get it to work.

Here's my latest try:

command_line $USER1$/check_by_ssh -H [gatewayhost] -C '$USER1$/check_by_ssh -H $HOSTADDRESS$ -C "$USER1$/check_load -w $ARG1$ -c $ARG2$"'

But Nagios complains about "could not open pipe". Other combinations of quotes and backslashes results in either the same error or complains about check_by_ssh parameters in either the outer or inner invocation. How do I get this to work?

I could use NRPE I suppose, but I much prefer check_by_ssh.

Best Answer

NRPE is one option that should work. But you could also use NSCA to setup distributed monitoring where you run Nagios, with the NSCA daemon and minus the web interface, on the machine that has a public IP at the remote site. The added bonus with NSCA is that the communication is encrypted at least.

Another option is to setup a VPN tunnel between the sites at which point you can directly monitor the computers in the cluster.

Related Topic