Return code 255 and flapping services on Solaris9

Peter Michael Calum pemca at tdc.dk
Sun Apr 20 16:12:05 CEST 2008


Hi

I dont think the debug.sh script works with check_by_ssh, it seems that
the parameters is misunderstood in some way

the command in my services.cfg looks like this :
------------------------------------------------
define service{
        use                             local-service         ; Name of
service template to use
        hostgroup_name                  SUN240, SUN440, SUN480, RHEL,
TSP4
        host_name                       khk23dsg6.ip.tdk.dk
        service_description             DISK
        check_command                   check_by_ssh! -l nagios -i
/home/nagios/.ssh/id_rsa -C 'plugin/check_disk -w 25% -c 15% -l -X
devfs'
        notifications_enabled           1
        }

I think maybe the 'plugin/check_disk -w 25% -c 15% -l -X devfs' gives
the problem 
(on the host called by check_by_ssh the plugins is in 'plugin/' under
the nagios user account) 


>> output from nagios_debug.log : (here the '' around the command has
disapeared)
---------------------------------
Sun Apr 20 15:55:03 CEST 2008 /usr/local/nagios/libexec/check_by_ssh -H
172.17.51.132 -l nagios -i /home/nagios/.ssh/id_rsa -C plugin/check_swap
-w 50 -c 30

/usr/local/nagios/libexec/check_by_ssh: invalid option -- w Usage:
check_by_ssh -H <host> -C <command> [-fqv] [-1|-2] [-4|-6] [-S [lines]]
[-E [lines]] [-t timeout] [-i identity] [-l user] [-n name] [-s
servicelist] [-O outputfile] [-p port] [-o ssh-option]

Exit code: 3


>> my command definition
-------------------------
# 'check_by_ssh' command definition
define command{
        command_name    check_by_ssh
        command_line    $USER1$/check_debug.sh $USER1$/check_by_ssh -H
$HOSTADDRESS$ $ARG1$
        } 

>> the debug script 
--------------------
[root at khk23dsg5 libexec]# cat check_debug.sh 
#!/bin/bash

OUTPUT=/usr/local/nagios/var/nagios_debug.log

echo `date` $* >> $OUTPUT

# Command should be first argument
RESULT=`$* 2>&1`
EXITCODE=$?

(
echo $RESULT
echo "Exit code: $EXITCODE"
) | tee -a $OUTPUT


rgds,
Peter


-----Oprindelig meddelelse-----
Fra: Ford, Andy [mailto:andyford at agedwards.com] 
Sendt: 19. april 2008 21:24
Til: Jay R. Ashworth; Peter Michael Calum
Cc: nagios-users at lists.sourceforge.net
Emne: RE: [Nagios-users] Return code 255 and flapping services on
Solaris9


> -----Original Message-----
> On Sat, Apr 19, 2008 at 09:22:03AM +0200, Peter Michael Calum wrote:
> > I'm just trying to find out what the difference is when i run the
> > check_by_ssh manually
> > and when it is done by nagios. But something must be wrong in
> > khk23dso3.ip.tdk.dk.
> 
> Ok, recap for us.
> 
> You never see it break when you run it manually, but it breaks how
> frequently when you let Nagios run it?
> 
> Side question to all: is there a way to configure nagios to 
> drop into a
> log file somewhere *precisely* what it hands off to a shell or exec
> when it runs a check-command?
> 
> Cheers,
> -- jra

To debug, you need to wrap your plugin call. See this fine article:
http://www.nagios.org/faqs/viewfaq.php?faq_id=379

Andy Ford
314-955-6647
andyford at agedwards.com
 


Wachovia Securities, LLC's outgoing and incoming e-mails are
electronically
archived and subject to review and/or disclosure to someone other
than the recipient.

A.G. Edwards, a division of Wachovia Securities, LLC




-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list