[Nagiosplug-help] Using check_by_ssh wrapper always sets UNKNOWN status

Lee Scott Lee.Scott at ihealthtechnologies.com
Tue Aug 28 16:13:55 CEST 2007


First, i've searched the mailing list archives and seen this issue touched
on before but nobody ever clear posts a solution so I'm asking again.  One
person hints at a solution but says the pluggins on the remote host need to
be modified to return the correct codes.  Since I'm using the nagios
pluggins on the remote hosts that's not an option and as my shell script
below shows I'm getting the correct codes back.

Config:
Nagios:                 2.9
Plugins:                1.4.9
OS (Nagios Host): Solaris 10 sparc
OS (Monitored):         Solaris 8 sparc, Solaris 9 sparc, Solaris 10 sparc

I'm attempting to monitor disk, load, processes on several remote machines
using the check_by_ssh plugin.  I am able to get access to the remote
systems without a password after setting up the authorized_keys file.  I'm
logging in as "nagios" on all systems.  I have tested my execution via
command line and checked the ?# return code and see the proper value.  Some
how the check_by_ssh plugin is not getting it and setting the status in
Nagios to "UNKNOWN" for all my commands I have configured this way.

Does anyone have a real solution?  I have tried the "2>/dev/null" solution,
the wrapping of the check pluggins in a script solution and just about
everything else I can think of.

My Config Files:
commands.cfg
# 'check_remote_load' command definition
define command {
        command_name            check_remote_load
        command_line            $USER1$/check_by_ssh -H $HOSTADDRESS$ -l
nagios -t 30 -C 'libexec/check_load -w $ARG1$ -c $ARG2$ 2>/dev/null'
        }

services.cfg:
define service {
        use                             defaults
        host_name                       blah
        service_description             Load
        servicegroups                   LOAD
        check_command
check_remote_load!5.0,4.0,3.0!10.0,6.0,4.0
        }

Nagios Interface Output:
blah  Load  UNKNOWN 08-28-2007 10:09:21 0d 17h 46m 40s 3/3 OK - load
average: 0.26, 0.24, 0.18

Shell Script to Test Command:
/usr/local/nagios/libexec/check_by_ssh -H blah -l nagios -t 30
'libexec/check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4.0 2>/dev/null'
echo $?

Shell Script Output:
OK - load average: 0.19, 0.22, 0.18|load1=0.191;5.000;10.000;0;
load5=0.219;4.000;6.000;0; load15=0.184;3.000;4.000;0;
0
--
CONFIDENTIALITY NOTICE:  This message and all attachments may contain
confidential information or the intellectual property of iHealth
Technologies, Inc. intended solely for the use of the addressee.   Any
unauthorized reading, distribution, copying, printing, retention or other
use of this message or its attachments is strictly prohibited.  If you
received this message in error, please contact the sender and delete the
all copies of the message from any computer.





More information about the Help mailing list