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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
venkstesh
Posts: 1
Joined: Thu Mar 22, 2018 9:23 pm

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

Post 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 ................ :(
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

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

Post 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 /

?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

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

Post 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.
kyang

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

Post by kyang »

Thanks for the help @tacolover101!

OP, please let us know your findings!
Locked