[Nagiosplug-devel] [ nagiosplug-Bugs-1706207 ] check_by_ssh always fails when host has a banner
SourceForge.net
noreply at sourceforge.net
Tue Apr 24 00:02:33 CEST 2007
Bugs item #1706207, was opened at 2007-04-23 23:41
Message generated for change (Comment added) made by hweiss
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1706207&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: Release (specify)
>Status: Closed
>Resolution: Duplicate
Priority: 5
Private: No
Submitted By: MurrayWilson (murraywilson)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_by_ssh always fails when host has a banner
Initial Comment:
The check_by_ssh plugin Version (nagios-plugins 1.4.8) 1.41 does not properly use the -S (skip lines) argument. Any host that as a banner will ALWAYS fail.
This is due to the code return the STATE_UNKNOWN code if there is any stderr output (chld_err.buflen != 0) regardless of the value of skip.
This chan be fixed by changing the code in main() after the call to np_runcmd() that reads:
/* UNKNOWN if output found on stderr */
if(chld_err.buflen) {
printf(_("Remote command execution failed: %s\n"),
chld_err.buflen ? chld_err.buf : _("Unknown error"));
return STATE_UNKNOWN;
}
to also check the value of skip:
/* UNKNOWN if output found on stderr */
if(chld_err.buflen && !skip) {
printf(_("Remote command execution failed: %s\n"),
chld_err.buflen ? chld_err.buf : _("Unknown error"));
return STATE_UNKNOWN;
}
Also, the help text in print_help() indicates that the long version of -S is --skiplines. However, the logopts[] array in process_arguments() specifies that --skip (not skiplines) is the long version of -S.
----------------------------------------------------------------------
>Comment By: Holger Weiss (hweiss)
Date: 2007-04-24 00:02
Message:
Logged In: YES
user_id=759506
Originator: NO
This has been reported in tracker ID 1675286 and fixed in CVS by adding
the new "-E/--skip-stderr" option (next to "-S/--skip-stdout"). See the
snapshot at:
http://nagiosplug.sourceforge.net/snapshot/
Alternatively, you could also use the "-q" option, which suppresses
non-critical output written to stderr by ssh(1) (such as banners).
Thanks, Holger
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1706207&group_id=29880
More information about the Devel
mailing list