Page 1 of 1

Return code of 255 is out of bounds : UNKNOWN - check_by_ssh

Posted: Thu Mar 22, 2018 9:55 pm
by venkstesh
I have installed 4.3.1. i am trying to monitor my sles11 machine using check_by_ssh.

i have created nagios user and installed nagios plugins in remote machines.

Return code of 255 is out of bounds : UNKNOWN - check_by_ssh: Remote command '/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /' returned status 255))

my commands.cfg is

define command{
command_name check_disk_by_ssh
command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C "/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$" -E
}

i have tried with -l nagios -i ~nagios/.ssh option in command line but no luck

define service{
use local-service
#hostgroup_name servers ; Name of service template to use
host_name <remote host>
service_description Root Partition
check_command check_disk_by_ssh!20%!10%!/
check_interval 1
max_check_attempts 1
notification_interval 0
notifications_enabled 1

}

please help me ................ :(

Re: Return code of 255 is out of bounds : UNKNOWN - check_by

Posted: Fri Mar 23, 2018 3:32 pm
by cdienger
What does the nrpe.cfg on the client show for the check_disk command? It should be:

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$

Is the check_disk command able to run directly on the client machine:

/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /

?

Re: Return code of 255 is out of bounds : UNKNOWN - check_by

Posted: Fri Mar 23, 2018 3:39 pm
by npolovenko
@venkstesh, You may try running the command with a verbose flag:

Code: Select all

 -v, --verbose
    Show details for command-line debugging (Nagios may truncate output)
Please run this command locally and show us the output:

Code: Select all

cd /usr/local/nagios/libexec/ 
./check_by_ssh -H IP_address -C "/usr/local/nagios/libexec/check_disk -w 20%  -c 10%"  -v
Also, you need to make sure that you can ssh from the nagios server to the remote server without entering password.

Code: Select all

ssh remote_server_ip
If you can't do it please refer to this tutorial:
https://www.ssh.com/ssh/copy-id

Re: Return code of 255 is out of bounds : UNKNOWN - check_by

Posted: Thu Apr 19, 2018 9:19 pm
by tacolover101
Return code of 255 is out of bounds : UNKNOWN - check_by_ssh: Remote command '/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /' returned status 255))
this error generally points to a permission error somewhere.

Re: Return code of 255 is out of bounds : UNKNOWN - check_by

Posted: Fri Apr 20, 2018 10:27 am
by kyang
Thanks for the help @tacolover101!

OP, please let us know your findings!