I'm new to Nagios, and I've been trying to get Nagios to handle a few simple check_by_ssh commands. I'm at the point where I'm successfully able to run the command from the command line like so:
#/usr/local/nagios/libexec/check_by_ssh -H HERP.DERP.COM -C "/home/derrp/bin/...
check_disk -w 50 -c 10 -A"
Which presents
DISK OK - free space: blah blah blah
So, that's good; it works o.k. from the command line. However, when I throw that into my commands.cfg file (using macros $USER1$
and $HOSTADDRESS$
at first, though the literal information yields the same results), and check Nagios' web interface to verify, it tells me
Remote command execution failed: ssh_askpass: exec(/usr/bin/ssh-askpass):
No such file or directory
I've ensured ssh-askpass is installed. What gives?
You have to set up ssh keys so that the 'nagios' user can ssh to the remote host(s) without a passphrase on the private key, or it cannot run checks using check_by_ssh.
Until you can run (as the nagios user) something like this...
... you do not have keys set up correctly.