0

I have a bastion server that has access to 50 machines running different Linux systems. I also have a separate Nagios server that has access to the bastion box. Is it possible to monitor the 50 machines via an ssh tunnel in the following manner:

Nagios box - [ssh tunnel] -> bastion box - [ssh tunnels 1....50] - Linux machines

There is no other direct connection to the 50 hosts from the Nagios box.

1
0

Several check_commands are called with the $HOSTADRESS argument in checkcommands.cfg in a "standard" configuration, as in:

/usr/lib/nagios/plugins/check_ping -H 10.1.1.2 -w 100.0,20% -c 500.0,60% -p 5
/usr/lib/nagios/plugins/check_nrpe -H 10.1.1.3 -c checkMEM -a ShowAll type=physical type=page type=virtual MaxWarn=90% MaxCrit=95%

So the actual file:

define command{
    command_name    check_nrpe
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

Either you define here something like (have not tested it):

define command{
    command_name    check_nrpe
    command_line    ssh $HOSTADDRESS$ "$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$"
}

Or your write a (very) ugly hack creating a shell wrapper to a couple of commands living under /usr/lib/nagios/plugins/´, namely/usr/lib/nagios/check_nrpe`, and then do diversions in Debian.

You will probably need more changes than this; if you do nrpe on top of ssh or similar, you won't need SSL on it.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.