1
0
monitoring-plugins/monitoring-plugins-2.3.3-check_by_ssh.patch
Lars Vogdt 7e6efb42c5 - Update to 2.3.3
Enhancements
  General
  + using PRId64 and PRIu64 instead of %ld directly
  Single Plugins
  + check_http: Make faster with larger files
  + check_snmp: add 'multiplier' to modify current value
  + check_http: Implement chunked encoding decoding
  + check_http/check_curl: add chunked encoding test
  + check_log: Added --exclude to exclude patterns
  + check_log: Add tests
  + check_disk: Clarify usage possibilites
  Fixes
  General
  + fixed two PRId64 to PRIu64 in perfdata_uint64
  Single Plugins
  + check_pgsql: Removing is_pg_dbname alltogether,using postgres API.
  + check_http: Remove superflous CRLF in HTTP-Requests
  + check_curl: detect ipv6
  + check_icmp: fix parsing help/version long options
  + check_http: fix test plan
  + check_disk: Find accessible mount path if multiple are available
  + check_apt: Fix unknown escape sequence error output
  + check_curl: fix checking large bodys
  + check_snmp: Improve tests for check_snmp & multiply option
  + check_snmp: always apply format when applying multiplier
  + check_http: Use real booleans instead of ints
  + check_http: Document process_arguments a little bit better
  + check_http: Remove dead code
  + check_http: Fix several bug in the implementation of unchunking

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins?expand=0&rev=101
2023-02-23 15:43:20 +00:00

47 lines
2.0 KiB
Diff

Index: monitoring-plugins-2.3.3/plugins/check_by_ssh.c
===================================================================
--- monitoring-plugins-2.3.3.orig/plugins/check_by_ssh.c
+++ monitoring-plugins-2.3.3/plugins/check_by_ssh.c
@@ -109,6 +109,13 @@ main (int argc, char **argv)
return STATE_UNKNOWN;
}
+ /* SSH returns 255 if connection attempt fails; include the first line of error output */
+ if (result == 255 && unknown_timeout) {
+ printf (_("SSH connection failed: %s\n"),
+ chld_err.lines > 0 ? chld_err.line[0] : "(no error output)");
+ return STATE_UNKNOWN;
+ }
+
if (verbose) {
for(i = 0; i < chld_out.lines; i++)
printf("stdout: %s\n", chld_out.line[i]);
@@ -455,12 +462,12 @@ print_help (void)
printf (" %s\n", _("Tell ssh to use this configfile [optional]"));
printf (" %s\n","-q, --quiet");
printf (" %s\n", _("Tell ssh to suppress warning and diagnostic messages [optional]"));
- printf (UT_WARN_CRIT);
- printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
- printf (" %s\n","-U, --unknown-timeout");
- printf (" %s\n", _("Make connection problems return UNKNOWN instead of CRITICAL"));
- printf (UT_VERBOSE);
- printf("\n");
+ printf (UT_WARN_CRIT);
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (" %s\n","-U, --unknown-timeout");
+ printf (" %s\n", _("Make connection problems return UNKNOWN instead of CRITICAL"));
+ printf (UT_VERBOSE);
+ printf("\n");
printf (" %s\n", _("The most common mode of use is to refer to a local identity file with"));
printf (" %s\n", _("the '-i' option. In this mode, the identity pair should have a null"));
printf (" %s\n", _("passphrase and the public key should be listed in the authorized_keys"));
@@ -479,7 +486,7 @@ print_help (void)
printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days");
printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days");
- printf(UT_SUPPORT);
+ printf(UT_SUPPORT);
}