#373 Check_by_ssh exit code always 0

closed
nobody
5
2008-06-11
2007-12-17
ADW
No

The "check_by_ssh" plugin report always an exit status/code of 0 when it should return a value of "2".
Should be the same for the other exit code values.

Plugin compiled from nagios-plugins-1.4.7.tar.gz on a RedHat Fedora Core Intel system.

Best regards

Discussion

  • ADW

    ADW - 2007-12-17

    Logged In: YES
    user_id=1961631
    Originator: YES

    I forgot to say that the problem only occur when using the "-f" (fork) option.

     
  • Matthias Eble

    Matthias Eble - 2008-01-04

    Logged In: YES
    user_id=1694341
    Originator: NO

    Hello alain,

    I've looked into this issue and can reproduce the described behaviour.. But: check_by_ssh's -f
    argument simply adds -f to the ssh call. With -f, ssh immediately returns, even if the remote command is still running. Actually there is no exit code at this point.

    However, check_by_ssh waits for the command output, IMO because it reads from the output file descriptor which is left open until the remote command execution is done.

    But this is a side effect.

    Note that
    /usr/bin/ssh -f 127.0.0.1 'exit 2' ;echo $?
    also returns 0. I'd thus say check_by_ssh -f works as desi(gn|r)ed

    I cannot imagine what -f should be good for though. But we should at least place
    a note in --help.

    Any other comments?

    Matthias

     
  • Ton Voon

    Ton Voon - 2008-05-27

    Logged In: YES
    user_id=664364
    Originator: NO

    Hi!

    I agree with Matthias - this works as designed. I've added a comment to the -f option to state that the return code has to be 0.

    A possibility is to remove the -f option, but that can be left for another discussion.

    I've marked the call to pending so it will auto-close after 7 days if there are no updates.

    Ton

     
  • Ton Voon

    Ton Voon - 2008-05-27
    • status: open --> pending
     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks