check_by_ssh failing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

check_by_ssh failing

Post by cunningrat »

I'm attempting to do a check_by_ssh check on an AS400 system.

Running the command from the command line (as nagios user) works:
[nagios@nagios ~]$ /usr/local/nagios/libexec/check_by_ssh -l NAGIOS -H XXX.XXX.XXX.XXX -C "/home/NAGIOS/check_as400_cpu.pl -w 50 -c 90"
CPU OK: CPU usage at 2.7%.

However, putting the command into Nagios does not work, returning "Remote command execution failed: Permission denied, please try again."

Nagios commands are running as nagios user. I've double-checked the permissions on the target system, and the ssh key in the authorized_keys file. Everything seems to be OK there.
Suggestions?
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

Re: check_by_ssh failing

Post by cunningrat »

Nevermind. Found the problem.

See, if you fumble-finger the IP address in the Nagios host definition, the remote system you're actually hitting doesn't have your SSH keys, so the Nagios commands don't work. Who'd've thought it...
Locked