SSH Check monitor fails, but works manually via CLI
Posted: Mon Jul 12, 2021 1:54 pm
Hello,
We have an SSH check that runs a remote script checking the license count for an application. When running the check via the actual service monitor, I get this result (I've changed IP information below):
[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_by_ssh -H [IP HERE] -C "~/check_ud.sh"
Remote command execution failed: Permission denied, please try again.
If I log into the server itself, and su - nagios from the root, running the same command, I get the expected output:
[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_by_ssh -H [IP HERE] -C "~/check_ud.sh"
Password:
OK - 341 is 71% of 478 Unidata Licenses used.|unidata=71%;90;95
It seems like the keypair/fingerprint is not present, but I've added that both via the IP and the hostname to known_hosts. I've also created a keypair on the nagios server itself and added the public key to the monitoring endpoint server.
What am I missing?
Thanks!
We have an SSH check that runs a remote script checking the license count for an application. When running the check via the actual service monitor, I get this result (I've changed IP information below):
[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_by_ssh -H [IP HERE] -C "~/check_ud.sh"
Remote command execution failed: Permission denied, please try again.
If I log into the server itself, and su - nagios from the root, running the same command, I get the expected output:
[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_by_ssh -H [IP HERE] -C "~/check_ud.sh"
Password:
OK - 341 is 71% of 478 Unidata Licenses used.|unidata=71%;90;95
It seems like the keypair/fingerprint is not present, but I've added that both via the IP and the hostname to known_hosts. I've also created a keypair on the nagios server itself and added the public key to the monitoring endpoint server.
What am I missing?
Thanks!