[Nagiosplug-devel] [ nagiosplug-Bugs-1706207 ] check_by_ssh always fails when host has a banner
SourceForge.net
noreply at sourceforge.net
Mon Apr 23 23:41:48 CEST 2007
Bugs item #1706207, was opened at 2007-04-23 17:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Resolution: None
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.
----------------------------------------------------------------------
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