Skip to main content

I am trying to use the nagios check_by_ssh plugin which downloaded the nagios-plugins-2.4.2.tar.gz tar file, unzipped and installed, created an RSA security key pair on the monitoring server and shared it to the server at monitor Prove the connection to these correctly, run the following command by terminal to test the execution of the check_by_ssh plugin /usr/lib64/nagios/plugins/check_by_ssh -H "monitored-server-ip" -C ls -E.
When executing it I have a correct response listing directories I try to create a check command in the path Configuration > Commands > Checks with the following instruction:
$USER1$/check_by_ssh -H $HOSTADDRESS$ -C $ARG1$ -E but the result that brings me a 255 status

Status information
UNKNOWN - check_by_ssh: Remote command 'ls' returned status 255

I don't know what could be wrong

 

 

Hello, 

Your check is executed with user centreon-engine. You need to add in the commande the user from the remote server with option -l

./check_by_ssh -H 172.30.8.42 -p 22 -C “remote_command or script" -l 'remote_user' -t 5

 

But you can use the plugin /usr/lib/centreon/plugins/centreon_linux_local.pl to execute remote scripts or commands.


Reply