Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package monitoring-plugins for openSUSE:Factory checked in at 2023-11-01 22:09:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/monitoring-plugins (Old) and /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "monitoring-plugins" Wed Nov 1 22:09:45 2023 rev:28 rq:1121479 version:2.3.3 Changes: -------- --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins.changes 2022-10-15 16:41:05.306676951 +0200 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins.changes 2023-11-01 22:10:23.516581960 +0100 @@ -1,0 +2,208 @@ +Mon Oct 30 18:19:23 CET 2023 - r...@suse.de + +- renamed patches + monitoring-plugins-wrong_return_in_check_swap.patch + to monitoring-plugins-2.3.3-wrong_percent_in_check_swap.patch + monitoring-plugins.check_snmp.arrayaddress.patch + to monitoring-plugins-2.3.3-check_snmp.arrayaddress.patch + monitoring-plugins-2.3-check_ntp_perf_absolute.patch + to monitoring-plugins-2.3.3-check_ntp_perf_absolute.patch + +------------------------------------------------------------------- +Mon Oct 16 13:23:42 UTC 2023 - Thorsten Kukuk <ku...@suse.com> + +- Add buildrequires for coreutils-systemd, as the configure script + checks for uptime [bsc#1216148] + +------------------------------------------------------------------- +Thu Jun 15 14:44:14 UTC 2023 - Thorsten Kukuk <ku...@suse.com> + +- systemd-not-utmp.patch: let check_users prefer systemd-logind + over utmp (jsc#PED-3144) + +------------------------------------------------------------------- +Wed May 31 21:57:07 UTC 2023 - David Disseldorp <dd...@suse.com> + +- Add attach_disconnected flag for usr.lib.nagios.plugins.check_procs + and usr.lib.nagios.plugins.check_procs.sle15 apparmor profiles to + permit /proc/PID/exe access; (bsc#1209194) + +------------------------------------------------------------------- +Thu Apr 13 15:27:12 UTC 2023 - Lars Vogdt <l...@linux-schulserver.de> - 2.3.3 + +- added monitoring-plugins-2.3.3-check_icmp.patch + Simple patch to avoid compiler errors with latest gcc +- removed monitoring-plugins-2.3.1-fixing-shellcheck.patch - upstream +- renamed monitoring-plugins-2.2-mariadb_102_build_fix.patch + to monitoring-plugins-2.3.3-mariadb_102_build_fix.patch + +------------------------------------------------------------------- +Wed Apr 12 20:54:19 UTC 2023 - Archie Cobbs <archie.co...@gmail.com> + +- added monitoring-plugins-2.3.3-check_http-proxy.patch + Fixes a check_http bug when trying to follow a redirect + returned from a URL retrieved via SSL proxy (issue #1764) + +------------------------------------------------------------------- +Wed Apr 12 17:35:53 UTC 2023 - Lars Vogdt <l...@linux-schulserver.de> - 2.3.3 + +- finally remove monitoring-plugins-1.4.6-Makefile_-_no_chown.patch: + obsoleted by monitoring-plugins-2.3.3-root-plugins-Makefile_-_no_chown.patch +- monitoring-plugins-2.1.1-check_log_-_quoting.patch renamed to + monitoring-plugins-2.3.3-check_log_-_quoting.patch + +------------------------------------------------------------------- +Thu Feb 2 17:11:00 UTC 2023 - Lars Vogdt <l...@linux-schulserver.de> - 2.3.3 + +- 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 + + check_http: Reformat a part to increase readability + + check_apt: Put upgrade options in the root sections + + check_apt: Fix comment + + check_apt: Use real booleans + + check_mailq: Fixing nullmailer regex + + check_snmp: Fix regex matches + + check_log: Fixed a bug when using --all + + check_log: Cleaned up duplicated code in the args + + check_http: Fix memory reallocation error in chunk decoding logic + + check_http: Add space for ending NULL byte in array for chunked encoding + +- included changes in 2.3.2 + General + + Use silent automake by default + + Fixes + Single Plugins + + check_by_ssh: added option to exit with an warning, if there is output on STDERR + + check_by_ssh: Add "-U" flag (#1123). + + check_by_ssh: Let ssh decide if a host is valid, enables usage of ssh .config file + + check_curl: Add an option to check_curl to verify the peer certificate & host using the system CA's + + check_curl: fixed -ffollow for HTTP/2.0 (Fixes #1685): added major_version parsing to PicoHTTPParser + + check_curl: fixes check_curl: "CRITICAL - Cannot retrieve certificate subject." + + check_curl: fix if http header contains leading spaces + + check_curl: Update check_curl.c to display a specific human-readable error message where possible + + check_curl: verify certificates option should not force SSL to be used + + check_disk: Description for -M was the wrong way around + + check_disk: Fixing the stuff that is broken on btrfs + + check_disk: Fix perfdata for big values for check disk + + check_disk_smb: Add configfile feature + + check_disk_smb: Add timeout + + check_dns: Add --expect-nxdomain + + check_dns: split multiple IP addresses passed in one -a argument + + check_file_age: Make size parameter a little bit more intelligible + + check_fping: Implements 'host-alive' mode (Closes. #1027) + + check_game: Update Url to qstat + + check_http: changed 'STATE_CRITICAL' to 'STATE_WARNING' for infinite loop + + check_http: Increase regexp limit by @hydrapolic + + check_http: Support http redirect by @waja + + check_icmp: buffer offerflow + + check_icmp: delay set_source_ip() until address_family is detected + + check_icmp: Fix "Invalid Argument" from sendmsg() under FreeBSD 13.1 and "setsockopt failed" for TTL setting + + check_icmp: Fix pkt perfdata in check_host mode + + check_ldap: Allows check_ldap to read password from environment variable + + check_load: add LOAD prefix to load plugin + + check_load: Display total and scaled load values if check_load scales the values by number of CPUs + + check_log: Missing oldlog now aborts check_log + + check_mailq: Add mailq -C option for config dir or config file + + check_mailq: Check mailq domain specific warnings + + check_mailq: Fix regexp for nullmailer "mailq" output + + check_mysql: fix segfaults with mysql-connector-c #1562 + + check_pgsql: add --queryname parameter to check_pgsql + + check_ping: Do not show RTA if no connection was possible + + check_ping: understang ping6 output from iputils package + + check_proc: Fix check proc ps detection + + check_procs: exchange needle and haystack in strstr() for proper state match + + check_smtp: add -L flag to support LMTP (LHLO instead of HELO/EHLO). + + check_snmp: Added option for null zero length string exit codes + + check_snmp: fix performance thresholds when using multiple oids + + check_snmp fix segfaults + + check_snmp: put the "c" (to mark a counter) after the perfdata value + + check_swap: fix parsing swap values + + check_swap: Fix perfdata for check swap + + check_swap: Fix unit for total in perfdata + + check_swap: Handle cached swap + + check_swap: Small fix to threshold validation and style (indentation) fixes + + check_ups: Fix possible overflow in check_ups + + check_uptime: Add option to report uptime in days instead of seconds + + check_uptime: Fix/improve output message "Uptime is ..." + + Multiple Plugins + + check_http, check_curl: added --max-redirs=N option (feature #1684) + + check_http, check_curl: Enhancement --continue-after-certificate (backport from nagios-plugins) + + check_http, check_curl: Remove check_http and check_curl test which are somehow always failing + + check_log, check_oracle, check_sensors: Several fixes shellcheck complaining about + + sslutils: use chain from client certificates + + Non functional changes + + Trivial source code whitespace formatting fixes to standard. + + docs: fix simple typo, conspicuosly -> conspicuously + + Migrate to GitHub actions + + Point to Icinga Exchange instead of dead Monitoring Exchange + + github actions: fix check_users test case + + Add CodeQL checks + + Fix some QL problems + + Update CodeQL and update runner before installing + + check_disk: Check disk compiler warnings + + check_disk: Trivial printf fix and a little bit of code style + + check_http: Docs: make -C obvious + + check_ifoperstatus: Re-attach a comment to where it actually belongs + + check_ircd: Restrict the nickname length of the test user for check_ircd + + check_load: Check load compiler warnings + + check_log Modernize check log + + check_mailq: remove duplicate W=i/C=i args in check_mailq.pl + + check_ntp: Check ntp remove unused variables + + check_pgsql: Using snprintf which honors the buffers size and guarantees null temination. (Closes: #1601) + + check_procs: Fix double percentage sign in usage + + check_sensors.sh: Make shellcheck happier + + check_snmp: Fixed option description authpassword -> authpasswd + whitespaces + + check_swap: Check swap compiler warnings + +- refreshed monitoring-plugins-1.4.6-Makefile_-_no_chown.patch + -> monitoring-plugins-2.3.3-root-plugins-Makefile_-_no_chown.patch +- refreshed monitoring-plugins-2.3.1-check_ssh.patch + -> monitoring-plugins-2.3.3-check_ssh.patch +- refreshed monitoring-plugins-2.3.1-check_dhcp_-_detect_rogue_dhcp_servers.patch + -> monitoring-plugins-2.3.3-check_dhcp_-_detect_rogue_dhcp_servers.patch +- refreshed monitoring-plugins-2.3.1-check_ssh.t_-_improve_testing.patch + -> monitoring-plugins-2.3.3-check_ssh.t_-_improve_testing.patch +- refreshed monitoring-plugins-2.3.1-check_disk_on_btrfs.patch + -> monitoring-plugins-2.3.3-check_disk_on_btrfs.patch +- refreshed monitoring-plugins-2.3.1-check_by_ssh.patch + -> monitoring-plugins-2.3.3-check_by_ssh.patch +- removed monitoring-plugins-too_few_arguments_for_check_disk.patch + -> fixed upstream +- removed monitoring-plugins.check_hpjd.c-64bit-portability-issue.patch + -> fixed upstream +- removed monitoring-plugins-2.3.1-check_snmp_segfaults.patch + -> fixed upstream + +------------------------------------------------------------------- Old: ---- monitoring-plugins-1.4.6-Makefile_-_no_chown.patch monitoring-plugins-2.1.1-check_log_-_quoting.patch monitoring-plugins-2.2-mariadb_102_build_fix.patch monitoring-plugins-2.3-check_ntp_perf_absolute.patch monitoring-plugins-2.3.1-check_by_ssh.patch monitoring-plugins-2.3.1-check_dhcp_-_detect_rogue_dhcp_servers.patch monitoring-plugins-2.3.1-check_disk_on_btrfs.patch monitoring-plugins-2.3.1-check_snmp_segfaults.patch monitoring-plugins-2.3.1-check_ssh.patch monitoring-plugins-2.3.1-check_ssh.t_-_improve_testing.patch monitoring-plugins-2.3.1-fixing-shellcheck.patch monitoring-plugins-2.3.1.tar.gz monitoring-plugins-2.3.1.tar.gz.sha1 monitoring-plugins-too_few_arguments_for_check_disk.patch monitoring-plugins-wrong_return_in_check_swap.patch monitoring-plugins.check_hpjd.c-64bit-portability-issue.patch monitoring-plugins.check_snmp.arrayaddress.patch New: ---- monitoring-plugins-2.3.3-check_by_ssh.patch monitoring-plugins-2.3.3-check_dhcp_-_detect_rogue_dhcp_servers.patch monitoring-plugins-2.3.3-check_disk_on_btrfs.patch monitoring-plugins-2.3.3-check_http-proxy.patch monitoring-plugins-2.3.3-check_icmp.patch monitoring-plugins-2.3.3-check_log_-_quoting.patch monitoring-plugins-2.3.3-check_ntp_perf_absolute.patch monitoring-plugins-2.3.3-check_snmp.arrayaddress.patch monitoring-plugins-2.3.3-check_ssh.patch monitoring-plugins-2.3.3-check_ssh.t_-_improve_testing.patch monitoring-plugins-2.3.3-mariadb_102_build_fix.patch monitoring-plugins-2.3.3-root-plugins-Makefile_-_no_chown.patch monitoring-plugins-2.3.3-wrong_percent_in_check_swap.patch monitoring-plugins-2.3.3.tar.gz monitoring-plugins-2.3.3.tar.gz.sha1 systemd-not-utmp.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ monitoring-plugins.spec ++++++ --- /var/tmp/diff_new_pack.noQ4EA/_old 2023-11-01 22:10:24.868632046 +0100 +++ /var/tmp/diff_new_pack.noQ4EA/_new 2023-11-01 22:10:24.872632195 +0100 @@ -17,7 +17,7 @@ Name: monitoring-plugins -Version: 2.3.1 +Version: 2.3.3 Release: 0 Summary: The Monitoring Plug-Ins License: GPL-2.0-or-later AND GPL-3.0-only @@ -62,33 +62,32 @@ Source59: nrpe-check_mysql Source60: nrpe-check_ups # PATCH-FIX-UPSTREAM Quote the options comming in from users (path names might contain whitespaces) -Patch1: %{name}-2.1.1-check_log_-_quoting.patch +Patch1: %{name}-2.3.3-check_log_-_quoting.patch # PATH-FIX-openSUSE - do not use/run chown in Makefile: we use RPM for this -Patch6: %{name}-1.4.6-Makefile_-_no_chown.patch +Patch6: %{name}-2.3.3-root-plugins-Makefile_-_no_chown.patch # PATCH-FIX-UPSTREAM Use correct pointer -Patch11: %{name}.check_snmp.arrayaddress.patch -# PATCH-FIX-UPSTREAM print out all arguments out a Group if in verbose mode -Patch15: %{name}-too_few_arguments_for_check_disk.patch -# PATCH-FIX-UPSTREAM port should be integer, not character -Patch118: %{name}.check_hpjd.c-64bit-portability-issue.patch +Patch11: %{name}-2.3.3-check_snmp.arrayaddress.patch # PATCH-FIX-UPSTREAM kstreit...@suse.com -- fix build with MariaDB 10.2 -Patch119: monitoring-plugins-2.2-mariadb_102_build_fix.patch +Patch119: %{name}-2.3.3-mariadb_102_build_fix.patch # PATCH-FIX-UPSTREAM see https://bugzilla.redhat.com/512559 -Patch121: %{name}-wrong_return_in_check_swap.patch +Patch121: %{name}-2.3.3-wrong_percent_in_check_swap.patch # PATCH-FIX-UPSTREAM - return ntp offset absolute (as positive value) in performance data since warn and crit are also positive values -Patch122: monitoring-plugins-2.3-check_ntp_perf_absolute.patch -# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1589 -Patch123: monitoring-plugins-2.3.1-check_snmp_segfaults.patch -# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1459 -Patch124: monitoring-plugins-2.3.1-fixing-shellcheck.patch +Patch122: %{name}-2.3.3-check_ntp_perf_absolute.patch # PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1322 -Patch125: monitoring-plugins-2.3.1-check_ssh.patch -Patch126: monitoring-plugins-2.3.1-check_ssh.t_-_improve_testing.patch +Patch125: monitoring-plugins-2.3.3-check_ssh.patch +Patch126: monitoring-plugins-2.3.3-check_ssh.t_-_improve_testing.patch # PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/issues/1375 -Patch127: monitoring-plugins-2.3.1-check_dhcp_-_detect_rogue_dhcp_servers.patch -Patch128: monitoring-plugins-2.3.1-check_disk_on_btrfs.patch +Patch127: monitoring-plugins-2.3.3-check_dhcp_-_detect_rogue_dhcp_servers.patch +Patch128: monitoring-plugins-2.3.3-check_disk_on_btrfs.patch # PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1774 -Patch129: monitoring-plugins-2.3.1-check_by_ssh.patch +Patch129: monitoring-plugins-2.3.3-check_by_ssh.patch +# +# PATCH-FIX-UPSTREAM - see https://github.com/monitoring-plugins/monitoring-plugins/pull/1862 +Patch130: monitoring-plugins-2.3.3-check_http-proxy.patch +# PATCH-FIX-UPSTREAM - simple fix for compiler error regarding no return value in function get_ip_address +Patch131: monitoring-plugins-2.3.3-check_icmp.patch +# PATCH-FEATURE-SLE - Use systemd-logind instead of utmp (jsc#PED-3144) +Patch132: systemd-not-utmp.patch BuildRequires: bind-utils BuildRequires: dhcp-devel BuildRequires: fping @@ -98,6 +97,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake +%if 0%{?suse_version} > 1599 +BuildRequires: coreutils-systemd +%endif BuildRequires: iputils BuildRequires: libdbi-devel BuildRequires: pkgconfig(smbclient) @@ -112,11 +114,14 @@ BuildRequires: net-snmp-perl BuildRequires: net-snmp-utils %else -BuildRequires: perl-Net-SNMP +BuildRequires: perl(Net::SNMP) %endif BuildRequires: postfix BuildRequires: postgresql-devel BuildRequires: procps +%if 0%{?suse_version} > 1599 +BuildRequires: systemd-devel +%endif BuildRequires: samba-client %if 0%{?suse_version} %if 0%{?suse_version} > 1020 @@ -631,7 +636,7 @@ Requires: net-snmp-perl Requires: net-snmp-utils %else -Requires: perl-Net-SNMP +Requires: perl(Net::SNMP) %endif Provides: nagios-plugins-ifoperstatus = %{version} Obsoletes: nagios-plugins-ifoperstatus <= 1.5 @@ -648,7 +653,7 @@ Requires: net-snmp-perl Requires: net-snmp-utils %else -Requires: perl-Net-SNMP +Requires: perl(Net::SNMP) %endif Provides: nagios-plugins-ifstatus = %{version} Obsoletes: nagios-plugins-ifstatus <= 1.5 @@ -1130,20 +1135,19 @@ %patch1 -p1 %patch6 -p1 %patch11 -p1 -%patch15 -p1 # Debian patches -%patch118 -p1 %patch119 -p1 %patch121 -p1 %patch122 -p1 # Github patches -%patch123 -p1 -%patch124 -p1 %patch125 -p1 %patch126 -p1 %patch127 -p1 %patch128 -p1 %patch129 -p1 +%patch130 -p1 +%patch131 -p1 +%patch132 -p1 find -type f -exec chmod 644 {} + %build ++++++ monitoring-plugins-2.3.1-check_by_ssh.patch -> monitoring-plugins-2.3.3-check_by_ssh.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.3.1-check_by_ssh.patch 2022-07-14 16:34:38.180649004 +0200 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-check_by_ssh.patch 2023-11-01 22:10:22.400540617 +0100 @@ -1,17 +1,10 @@ -diff -ur monitoring-plugins-2.3.1.orig/plugins/check_by_ssh.c monitoring-plugins-2.3.1/plugins/check_by_ssh.c ---- monitoring-plugins-2.3.1.orig/plugins/check_by_ssh.c 2021-04-10 07:13:41.000000000 -0500 -+++ monitoring-plugins-2.3.1/plugins/check_by_ssh.c 2022-07-02 10:33:49.977417534 -0500 -@@ -49,6 +49,7 @@ - unsigned int services = 0; - int skip_stdout = 0; - int skip_stderr = 0; -+int unknown_timeout = 0; - char *remotecmd = NULL; - char **commargv = NULL; - int commargc = 0; -@@ -100,6 +101,13 @@ - - result = cmd_run_array (commargv, &chld_out, &chld_err, 0); +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) { @@ -23,48 +16,31 @@ if (verbose) { for(i = 0; i < chld_out.lines; i++) printf("stdout: %s\n", chld_out.line[i]); -@@ -176,6 +184,7 @@ - {"verbose", no_argument, 0, 'v'}, - {"fork", no_argument, 0, 'f'}, - {"timeout", required_argument, 0, 't'}, -+ {"unknown-timeout", no_argument, 0, 'U'}, - {"host", required_argument, 0, 'H'}, /* backward compatibility */ - {"hostname", required_argument, 0, 'H'}, - {"port", required_argument,0,'p'}, -@@ -207,7 +216,7 @@ - strcpy (argv[c], "-t"); - - while (1) { -- c = getopt_long (argc, argv, "Vvh1246fqt:H:O:p:i:u:l:C:S::E::n:s:o:F:", longopts, -+ c = getopt_long (argc, argv, "Vvh1246fqt:UH:O:p:i:u:l:C:S::E::n:s:o:F:", longopts, - &option); - - if (c == -1 || c == EOF) -@@ -229,6 +238,9 @@ - else - timeout_interval = atoi (optarg); - break; -+ case 'U': -+ unknown_timeout = 1; -+ break; - case 'H': /* host */ - host_or_die(optarg); - hostname = optarg; -@@ -437,6 +449,8 @@ +@@ -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 (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")); -@@ -466,7 +480,7 @@ - print_usage (void) - { - printf ("%s\n", _("Usage:")); -- printf (" %s -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]\n" -+ printf (" %s -H <host> -C <command> [-fqvU] [-1|-2] [-4|-6]\n" - " [-S [lines]] [-E [lines]] [-t timeout] [-i identity]\n" - " [-l user] [-n name] [-s servicelist] [-O outputfile]\n" - " [-p port] [-o ssh-option] [-F configfile]\n", + 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); + } + + ++++++ monitoring-plugins-2.3.1-check_dhcp_-_detect_rogue_dhcp_servers.patch -> monitoring-plugins-2.3.3-check_dhcp_-_detect_rogue_dhcp_servers.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.3.1-check_dhcp_-_detect_rogue_dhcp_servers.patch 2021-11-23 22:12:48.138435036 +0100 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-check_dhcp_-_detect_rogue_dhcp_servers.patch 2023-11-01 22:10:22.408540913 +0100 @@ -1,7 +1,7 @@ -Index: monitoring-plugins-2.3.1/plugins-root/check_dhcp.c +Index: monitoring-plugins-2.3.3/plugins-root/check_dhcp.c =================================================================== ---- monitoring-plugins-2.3.1.orig/plugins-root/check_dhcp.c -+++ monitoring-plugins-2.3.1/plugins-root/check_dhcp.c +--- monitoring-plugins-2.3.3.orig/plugins-root/check_dhcp.c ++++ monitoring-plugins-2.3.3/plugins-root/check_dhcp.c @@ -156,6 +156,7 @@ typedef struct dhcp_offer_struct{ u_int32_t lease_time; /* lease time in seconds */ u_int32_t renewal_time; /* renewal time in seconds */ ++++++ monitoring-plugins-2.3.1-check_disk_on_btrfs.patch -> monitoring-plugins-2.3.3-check_disk_on_btrfs.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.3.1-check_disk_on_btrfs.patch 2022-03-26 22:31:23.381980229 +0100 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-check_disk_on_btrfs.patch 2023-11-01 22:10:22.420541358 +0100 @@ -4,21 +4,21 @@ check_disk - fix false DISK CRITICAL alert for btrfs filesystems due to BSD Gnulib workaround -diff --git a/plugins/check_disk.c b/plugins/check_disk.c -index 2f20e47a..c813ad65 100755 ---- a/plugins/check_disk.c -+++ b/plugins/check_disk.c -@@ -1310,10 +1310,14 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { +Index: monitoring-plugins-2.3.3/plugins/check_disk.c +=================================================================== +--- monitoring-plugins-2.3.3.orig/plugins/check_disk.c ++++ monitoring-plugins-2.3.3/plugins/check_disk.c +@@ -1041,7 +1041,14 @@ get_stats (struct parameter_list *p, str void get_path_stats (struct parameter_list *p, struct fs_usage *fsp) { +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(OpenBSD ) - /* 2007-12-08 - Workaround for Gnulib reporting insanely high available - * space on BSD (the actual value should be negative but fsp->fsu_bavail - * is unsigned) */ - p->available = fsp->fsu_bavail > fsp->fsu_bfree ? 0 : fsp->fsu_bavail; ++ /* 2007-12-08 - Workaround for Gnulib reporting insanely high available ++ * space on BSD (the actual value should be negative but fsp->fsu_bavail ++ * is unsigned) */ ++ p->available = fsp->fsu_bavail > fsp->fsu_bfree ? 0 : fsp->fsu_bavail; +#else -+ p->available = fsp->fsu_bavail; + p->available = fsp->fsu_bavail; +#endif p->available_to_root = fsp->fsu_bfree; p->used = fsp->fsu_blocks - fsp->fsu_bfree; ++++++ monitoring-plugins-2.3.3-check_http-proxy.patch ++++++ diff --git a/plugins/check_http.c b/plugins/check_http.c index 8dda046f..2ab6a7a3 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -126,6 +126,9 @@ int sd; int min_page_len = 0; int max_page_len = 0; int redir_depth = 0; +bool ssl_proxy = false; +char *proxy_server_address; +int proxy_server_port; int max_depth = DEFAULT_MAX_REDIRS; char *http_method; char *http_method_proxy; @@ -139,6 +142,7 @@ char *client_privkey = NULL; bool process_arguments (int, char **); int check_http (void); void redir (char *pos, char *status_line); +const char *find_uri_path (const char *url); bool server_type_check(const char *type); int server_port_check(int ssl_flag); char *perfd_time (double microsec); @@ -608,6 +612,17 @@ bool process_arguments (int argc, char **argv) if (virtual_port == 0) virtual_port = server_port; + /* if we are called with the -I option, the -j method is CONNECT and */ + /* we received -S for SSL, then we tunnel the request through a proxy*/ + /* @20100414, public[at]frank4dd.com, http://www.frank4dd.com/howto */ + + ssl_proxy = server_address != NULL && strcmp(http_method, "CONNECT") == 0 + && host_name != NULL && use_ssl == true; + if (ssl_proxy) { + proxy_server_address = strdup(server_address); + proxy_server_port = server_port; + } + return true; } @@ -939,18 +954,18 @@ check_http (void) /* try to connect to the host at the given port number */ gettimeofday (&tv_temp, NULL); - if (my_tcp_connect (server_address, server_port, &sd) != STATE_OK) + result = ssl_proxy ? + my_tcp_connect (proxy_server_address, proxy_server_port, &sd) : + my_tcp_connect (server_address, server_port, &sd); + if (result != STATE_OK) die (STATE_CRITICAL, _("HTTP CRITICAL - Unable to open TCP socket\n")); microsec_connect = deltime (tv_temp); - /* if we are called with the -I option, the -j method is CONNECT and */ - /* we received -S for SSL, then we tunnel the request through a proxy*/ - /* @20100414, public[at]frank4dd.com, http://www.frank4dd.com/howto */ + /* handle connection via SSL proxy */ + if (ssl_proxy) { - if ( server_address != NULL && strcmp(http_method, "CONNECT") == 0 - && host_name != NULL && use_ssl == true) { - - if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", server_address, server_port, host_name, HTTPS_PORT); + if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", + proxy_server_address, proxy_server_port, host_name, HTTPS_PORT); asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent); if (strlen(proxy_auth)) { base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth); @@ -985,7 +1000,7 @@ check_http (void) if (use_ssl == true) { gettimeofday (&tv_temp, NULL); result = np_net_ssl_init_with_hostname_version_and_cert(sd, (use_sni ? host_name : NULL), ssl_version, client_cert, client_privkey); - if (verbose) printf ("SSL initialized\n"); + if (verbose) printf ("SSL initialization %s\n", result == STATE_OK ? "successful" : "failed"); if (result != STATE_OK) die (STATE_CRITICAL, NULL); microsec_ssl = deltime (tv_temp); @@ -1001,9 +1016,8 @@ check_http (void) } #endif /* HAVE_SSL */ - if ( server_address != NULL && strcmp(http_method, "CONNECT") == 0 - && host_name != NULL && use_ssl == true) - asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method_proxy, server_url, host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent); + if (ssl_proxy) + asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method_proxy, find_uri_path(server_url), host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent); else asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method, server_url, host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent); @@ -1032,8 +1046,7 @@ check_http (void) */ if ((use_ssl == false && virtual_port == HTTP_PORT) || (use_ssl == true && virtual_port == HTTPS_PORT) || - (server_address != NULL && strcmp(http_method, "CONNECT") == 0 - && host_name != NULL && use_ssl == true)) + ssl_proxy) xasprintf (&buf, "%sHost: %s\r\n", buf, host_name); else xasprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, virtual_port); @@ -1137,10 +1150,17 @@ check_http (void) /* leave full_page untouched so we can free it later */ page = full_page; - if (verbose) - printf ("%s://%s:%d%s is %d characters\n", - use_ssl ? "https" : "http", server_address, - server_port, server_url, (int)pagesize); + if (verbose) { + if (ssl_proxy) { + printf ("[via proxy %s://%s:%d] %s returned %d bytes\n", + use_ssl ? "https" : "http", proxy_server_address, proxy_server_port, + server_url, (int)pagesize); + } else { + printf ("%s://%s:%d%s returned %d bytes\n", + use_ssl ? "https" : "http", server_address, + server_port, server_url, (int)pagesize); + } + } /* find status line and null-terminate it */ status_line = page; @@ -1300,7 +1320,12 @@ check_http (void) bcopy("...", &output_string_search[sizeof(output_string_search) - 4], 4); } - xasprintf (&msg, _("%sstring '%s' not found on '%s://%s:%d%s', "), msg, output_string_search, use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); + if (ssl_proxy) { + xasprintf (&msg, _("%sstring '%s' not found on '%s', "), msg, output_string_search, server_url); + } else { + xasprintf (&msg, _("%sstring '%s' not found on '%s://%s:%d%s', "), msg, output_string_search, + use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); + } result = STATE_CRITICAL; } } @@ -1642,6 +1667,25 @@ redir (char *pos, char *status_line) check_http (); } +// Locate the URI path inside a complete URL. If we fail, just return the original URL. +const char * +find_uri_path (const char *url) +{ + const char *s = url; + + if (strncmp(s, "http://", 7) == 0) + s += 7; + else if (strncmp(s, "https://", 8) == 0) + s += 8; + else + return url; + while (*s != '\0') { + if (strchr("/?#", *s) != NULL) + return s; + s++; + } + return url; +} bool server_type_check (const char *type) @@ -1861,7 +1905,7 @@ print_help (void) printf (" %s\n", _("a STATE_OK is returned. When the certificate is still valid, but for less than")); printf (" %s\n", _("30 days, but more than 14 days, a STATE_WARNING is returned.")); printf (" %s\n", _("A STATE_CRITICAL will be returned when certificate expires in less than 14 days")); - + printf ("\n"); printf (" %s\n\n", "CHECK SSL WEBSERVER CONTENT VIA PROXY USING HTTP 1.1 CONNECT: "); printf (" %s\n", _("check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j CONNECT -H www.verisign.com ")); printf (" %s\n", _("all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -S(sl) -j CONNECT -H <webserver>")); ++++++ monitoring-plugins-2.3.3-check_icmp.patch ++++++ Index: monitoring-plugins-2.3.3/plugins-root/check_icmp.c =================================================================== --- monitoring-plugins-2.3.3.orig/plugins-root/check_icmp.c +++ monitoring-plugins-2.3.3/plugins-root/check_icmp.c @@ -1446,6 +1446,7 @@ get_ip_address(const char *ifname) #else errno = 0; crash("Cannot get interface IP address on this platform."); + return INADDR_NONE; #endif } ++++++ monitoring-plugins-2.1.1-check_log_-_quoting.patch -> monitoring-plugins-2.3.3-check_log_-_quoting.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.1.1-check_log_-_quoting.patch 2021-11-23 22:12:48.126435076 +0100 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-check_log_-_quoting.patch 2023-11-01 22:10:22.448542395 +0100 @@ -1,90 +1,33 @@ -Index: monitoring-plugins-2.3.1/plugins-scripts/check_log.sh +Index: monitoring-plugins-2.3.3/plugins-scripts/check_log.sh =================================================================== ---- monitoring-plugins-2.3.1.orig/plugins-scripts/check_log.sh -+++ monitoring-plugins-2.3.1/plugins-scripts/check_log.sh -@@ -115,27 +115,27 @@ while test -n "$1"; do - exit $STATE_OK +--- monitoring-plugins-2.3.3.orig/plugins-scripts/check_log.sh ++++ monitoring-plugins-2.3.3/plugins-scripts/check_log.sh +@@ -112,23 +112,23 @@ while test -n "$1"; do + exit "$STATE_OK" ;; - --filename) + -F | --filename) - logfile=$2 + logfile="$2" - shift + shift 2 ;; - -F) -- logfile=$2 -+ logfile="$2" - shift - ;; - --oldlog) -- oldlog=$2 -+ oldlog="$2" - shift - ;; - -O) + -O | --oldlog) - oldlog=$2 + oldlog="$2" - shift + shift 2 ;; - --query) + -q | --query) - query=$2 + query="$2" - shift + shift 2 ;; - -q) -- query=$2 -+ query="$2" - shift + --exclude) +- exclude=$2 ++ exclude="$2" + shift 2 + ;; + -x | --exitstatus) +- exitstatus=$2 ++ exitstatus="$2" + shift 2 ;; - -x) -@@ -157,10 +157,10 @@ done - - # If the source log file doesn't exist, exit - --if [ ! -e $logfile ]; then -+if [ ! -e "$logfile" ]; then - echo "Log check error: Log file $logfile does not exist!" - exit $STATE_UNKNOWN --elif [ ! -r $logfile ] ; then -+elif [ ! -r "$logfile" ] ; then - echo "Log check error: Log file $logfile is not readable!" - exit $STATE_UNKNOWN - fi -@@ -169,8 +169,8 @@ fi - # we're running this test, so copy the original log file over to - # the old diff file and exit - --if [ ! -e $oldlog ]; then -- cat $logfile > $oldlog -+if [ ! -e "$oldlog" ]; then -+ cat "$logfile" > "$oldlog" - echo "Log check data initialized..." - exit $STATE_OK - fi -@@ -184,20 +184,20 @@ if [ -x /bin/mktemp ]; then - else - tempdiff=`/bin/date '+%H%M%S'` - tempdiff="/tmp/check_log.${tempdiff}" -- touch $tempdiff -- chmod 600 $tempdiff -+ touch "$tempdiff" -+ chmod 600 "$tempdiff" - fi - --diff $logfile $oldlog | grep -v "^>" > $tempdiff -+diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff" - - # Count the number of matching log entries we have --count=`grep -c "$query" $tempdiff` -+count=`grep -c "$query" "$tempdiff"` - - # Get the last matching entry in the diff file --lastentry=`grep "$query" $tempdiff | tail -1` -+lastentry=`grep "$query" "$tempdiff" | tail -1` - --rm -f $tempdiff --cat $logfile > $oldlog -+rm -f "$tempdiff" -+cat "$logfile" > "$oldlog" - - if [ "$count" = "0" ]; then # no matches, exit with no error - echo "Log check ok - 0 pattern matches found" + -e | --extended-regex) ++++++ monitoring-plugins-2.3-check_ntp_perf_absolute.patch -> monitoring-plugins-2.3.3-check_ntp_perf_absolute.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.3-check_ntp_perf_absolute.patch 2021-04-29 01:39:22.482661293 +0200 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-check_ntp_perf_absolute.patch 2023-11-01 22:10:22.456542691 +0100 @@ -1,7 +1,7 @@ -Index: monitoring-plugins-2.3.1/plugins/check_ntp_time.c +Index: monitoring-plugins-2.3.3/plugins/check_ntp_time.c =================================================================== ---- monitoring-plugins-2.3.1.orig/plugins/check_ntp_time.c -+++ monitoring-plugins-2.3.1/plugins/check_ntp_time.c +--- monitoring-plugins-2.3.3.orig/plugins/check_ntp_time.c ++++ monitoring-plugins-2.3.3/plugins/check_ntp_time.c @@ -533,7 +533,7 @@ int process_arguments(int argc, char **a char *perfd_offset (double offset) ++++++ monitoring-plugins-2.3.3-check_snmp.arrayaddress.patch ++++++ Index: monitoring-plugins-2.3.3/plugins/check_snmp.c =================================================================== --- monitoring-plugins-2.3.3.orig/plugins/check_snmp.c +++ monitoring-plugins-2.3.3/plugins/check_snmp.c @@ -594,7 +594,7 @@ main (int argc, char **argv) len = sizeof(perfstr)-strlen(perfstr)-1; strncat(perfstr, show, len>ptr-show ? ptr-show : len); - if (type) + if (type[0]) strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1); if (warning_thresholds) { ++++++ monitoring-plugins-2.3.1-check_ssh.patch -> monitoring-plugins-2.3.3-check_ssh.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.3.1-check_ssh.patch 2021-11-23 22:12:48.170434930 +0100 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-check_ssh.patch 2023-11-01 22:10:22.636549359 +0100 @@ -26,11 +26,20 @@ plugins/t/check_ssh.t | 97 ++++++++++++++++++++++++++------- 2 files changed, 164 insertions(+), 55 deletions(-) -diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c -index 3658965e5..fc2ceb78b 100644 ---- a/plugins/check_ssh.c -+++ b/plugins/check_ssh.c -@@ -215,8 +215,13 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol +Index: monitoring-plugins-2.3.3/plugins/check_ssh.c +=================================================================== +--- monitoring-plugins-2.3.3.orig/plugins/check_ssh.c ++++ monitoring-plugins-2.3.3/plugins/check_ssh.c +@@ -106,7 +106,7 @@ process_arguments (int argc, char **argv + {"timeout", required_argument, 0, 't'}, + {"verbose", no_argument, 0, 'v'}, + {"remote-version", required_argument, 0, 'r'}, +- {"remote-protcol", required_argument, 0, 'P'}, ++ {"remote-protocol", required_argument, 0, 'P'}, + {0, 0, 0, 0} + }; + +@@ -215,8 +215,13 @@ ssh_connect (char *haddr, int hport, cha { int sd; int result; @@ -44,7 +53,7 @@ char *ssh_proto = NULL; char *ssh_server = NULL; static char *rev_no = VERSION; -@@ -231,51 +236,94 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol +@@ -231,51 +236,118 @@ ssh_connect (char *haddr, int hport, cha return result; output = (char *) malloc (BUFF_SZ + 1); @@ -95,11 +104,35 @@ + printf("SSH CRITICAL - No version control string received"); + exit(STATE_CRITICAL); + } ++ /* ++ * "When the connection has been established, both sides MUST send an ++ * identification string. This identification string MUST be ++ * ++ * SSH-protoversion-softwareversion SP comments CR LF" ++ * - RFC 4253:4.2 ++ */ + strip (version_control_string); + if (verbose) + printf ("%s\n", version_control_string); + ssh_proto = version_control_string + 4; -+ ssh_server = ssh_proto + strspn (ssh_proto, "-0123456789."); ++ ++ /* ++ * We assume the protoversion is of the form Major.Minor, although ++ * this is not _strictly_ required. See ++ * ++ * "Both the 'protoversion' and 'softwareversion' strings MUST consist of ++ * printable US-ASCII characters, with the exception of whitespace ++ * characters and the minus sign (-)" ++ * - RFC 4253:4.2 ++ * and, ++ * ++ * "As stated earlier, the 'protoversion' specified for this protocol is ++ * "2.0". Earlier versions of this protocol have not been formally ++ * documented, but it is widely known that they use 'protoversion' of ++ * "1.x" (e.g., "1.5" or "1.3")." ++ * - RFC 4253:5 ++ */ ++ ssh_server = ssh_proto + strspn (ssh_proto, "0123456789.") + 1; /* (+1 for the '-' separating protoversion from softwareversion) */ + + /* If there's a space in the version string, whatever's after the space is a comment + * (which is NOT part of the server name/version)*/ @@ -131,8 +164,7 @@ - close(sd); - exit (STATE_CRITICAL); - } -+ ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0; - +- - if (remote_protocol && strcmp(remote_protocol, ssh_proto)) { - printf - (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"), @@ -140,31 +172,33 @@ - close(sd); - exit (STATE_CRITICAL); - } ++ ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0; + +- elapsed_time = (double)deltime(tv) / 1.0e6; + xasprintf (&buffer, "SSH-%s-check_ssh_%s\r\n", ssh_proto, rev_no); + send (sd, buffer, strlen (buffer), MSG_DONTWAIT); + if (verbose) + printf ("%s\n", buffer); -- elapsed_time = (double)deltime(tv) / 1.0e6; + if (remote_version && strcmp(remote_version, ssh_server)) { -+ printf -+ (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"), -+ ssh_server, ssh_proto, remote_version); -+ close(sd); -+ exit (STATE_CRITICAL); -+ } - -+ if (remote_protocol && strcmp(remote_protocol, ssh_proto)) { printf - (_("SSH OK - %s (protocol %s) | %s\n"), - ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s", - FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout)); -+ (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"), -+ ssh_server, ssh_proto, remote_protocol); ++ (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"), ++ ssh_server, ssh_proto, remote_version); close(sd); - exit (STATE_OK); + exit (STATE_CRITICAL); } ++ ++ if (remote_protocol && strcmp(remote_protocol, ssh_proto)) { ++ printf ++ (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"), ++ ssh_server, ssh_proto, remote_protocol); ++ close(sd); ++ exit (STATE_CRITICAL); ++ } + elapsed_time = (double)deltime(tv) / 1.0e6; + + printf @@ -176,71 +210,3 @@ } -diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c -index fc2ceb78b..7b576895f 100644 ---- a/plugins/check_ssh.c -+++ b/plugins/check_ssh.c -@@ -278,11 +278,35 @@ ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol - printf("SSH CRITICAL - No version control string received"); - exit(STATE_CRITICAL); - } -+ /* -+ * "When the connection has been established, both sides MUST send an -+ * identification string. This identification string MUST be -+ * -+ * SSH-protoversion-softwareversion SP comments CR LF" -+ * - RFC 4253:4.2 -+ */ - strip (version_control_string); - if (verbose) - printf ("%s\n", version_control_string); - ssh_proto = version_control_string + 4; -- ssh_server = ssh_proto + strspn (ssh_proto, "-0123456789."); -+ -+ /* -+ * We assume the protoversion is of the form Major.Minor, although -+ * this is not _strictly_ required. See -+ * -+ * "Both the 'protoversion' and 'softwareversion' strings MUST consist of -+ * printable US-ASCII characters, with the exception of whitespace -+ * characters and the minus sign (-)" -+ * - RFC 4253:4.2 -+ * and, -+ * -+ * "As stated earlier, the 'protoversion' specified for this protocol is -+ * "2.0". Earlier versions of this protocol have not been formally -+ * documented, but it is widely known that they use 'protoversion' of -+ * "1.x" (e.g., "1.5" or "1.3")." -+ * - RFC 4253:5 -+ */ -+ ssh_server = ssh_proto + strspn (ssh_proto, "0123456789.") + 1; /* (+1 for the '-' separating protoversion from softwareversion) */ - - /* If there's a space in the version string, whatever's after the space is a comment - * (which is NOT part of the server name/version)*/ - - -From 59bed139e84fd6342d4203ebebca28bf2f4dcc82 Mon Sep 17 00:00:00 2001 -From: Anton Lofgren <alofg...@op5.com> -Date: Fri, 30 Jan 2015 10:52:20 +0100 -Subject: [PATCH 4/4] check_ssh: Fix a typo in "remote-protocol parameter - -remote-protcol -> remote-protocol - -Signed-off-by: Anton Lofgren <alofg...@op5.com> ---- - plugins/check_ssh.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c -index 7b576895f..f12f34051 100644 ---- a/plugins/check_ssh.c -+++ b/plugins/check_ssh.c -@@ -106,7 +106,7 @@ process_arguments (int argc, char **argv) - {"timeout", required_argument, 0, 't'}, - {"verbose", no_argument, 0, 'v'}, - {"remote-version", required_argument, 0, 'r'}, -- {"remote-protcol", required_argument, 0, 'P'}, -+ {"remote-protocol", required_argument, 0, 'P'}, - {0, 0, 0, 0} - }; - ++++++ monitoring-plugins-2.3.1-check_ssh.t_-_improve_testing.patch -> monitoring-plugins-2.3.3-check_ssh.t_-_improve_testing.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.3.1-check_ssh.t_-_improve_testing.patch 2021-11-23 22:12:48.182434891 +0100 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-check_ssh.t_-_improve_testing.patch 2023-11-01 22:10:22.732552916 +0100 @@ -1,11 +1,11 @@ -Index: monitoring-plugins-2.3.1/plugins/t/check_ssh.t +Index: monitoring-plugins-2.3.3/plugins/t/check_ssh.t =================================================================== ---- monitoring-plugins-2.3.1.orig/plugins/t/check_ssh.t -+++ monitoring-plugins-2.3.1/plugins/t/check_ssh.t +--- monitoring-plugins-2.3.3.orig/plugins/t/check_ssh.t ++++ monitoring-plugins-2.3.3/plugins/t/check_ssh.t @@ -8,34 +8,105 @@ use strict; use Test::More; use NPTest; - + -# Required parameters -my $ssh_host = getTestParameter("NP_SSH_HOST", "A host providing SSH service", "localhost"); -my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1" ); @@ -21,7 +21,8 @@ - ); -cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)"); -like($result->output, '/^SSH OK - /', "Status text if command returned none (OK)"); -- ++my $res; + - -$result = NPTest->testCmd( - "./check_ssh -H $host_nonresponsive -t 2" @@ -36,8 +37,6 @@ - ); -cmp_ok($result->return_code, '==', 3, "Exit with return code 0 (OK)"); -like($result->output, '/^check_ssh: Invalid hostname/', "Status text if command returned none (OK)"); -+my $res; - +# Required parameters +my $ssh_host = getTestParameter("NP_SSH_HOST", + "A host providing SSH service", @@ -137,4 +136,4 @@ + cmp_ok( $res->return_code, '==', 0, "Got delayed SSH protocol version control string"); + like( $res->output, '/^SSH OK - nagiosplug.ssh.0.2 \(protocol 2.0\)/', "Output OK"); + close NC; -+ + ++++++ monitoring-plugins-2.2-mariadb_102_build_fix.patch -> monitoring-plugins-2.3.3-mariadb_102_build_fix.patch ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.2-mariadb_102_build_fix.patch 2021-04-29 01:39:22.466661270 +0200 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3-mariadb_102_build_fix.patch 2023-11-01 22:10:22.772554398 +0100 @@ -30,22 +30,20 @@ plugins/check_mysql_query.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) -Index: monitoring-plugins-2.3.1/plugins/check_mysql.c +Index: monitoring-plugins-2.3.3/plugins/check_mysql.c =================================================================== ---- monitoring-plugins-2.3.1.orig/plugins/check_mysql.c -+++ monitoring-plugins-2.3.1/plugins/check_mysql.c -@@ -36,6 +36,10 @@ const char *email = "devel@monitoring-pl +--- monitoring-plugins-2.3.3.orig/plugins/check_mysql.c ++++ monitoring-plugins-2.3.3/plugins/check_mysql.c +@@ -35,6 +35,8 @@ const char *copyright = "1999-2011"; + const char *email = "de...@monitoring-plugins.org"; #define SLAVERESULTSIZE 70 - +/* The default port that MySQL servers listen on. */ +#define CHECK_PORT_DEFAULT 3306 -+ -+ + #include "common.h" #include "utils.h" - #include "utils_base.h" -@@ -58,7 +62,7 @@ char *ciphers = NULL; +@@ -58,7 +60,7 @@ char *ciphers = NULL; bool ssl = false; char *opt_file = NULL; char *opt_group = NULL; @@ -54,7 +52,7 @@ int check_slave = 0, warn_sec = 0, crit_sec = 0; int ignore_auth = 0; int verbose = 0; -@@ -508,7 +512,7 @@ void +@@ -508,7 +510,7 @@ void print_help (void) { char *myport; @@ -63,22 +61,21 @@ print_revision (progname, NP_VERSION); -Index: monitoring-plugins-2.3.1/plugins/check_mysql_query.c +Index: monitoring-plugins-2.3.3/plugins/check_mysql_query.c =================================================================== ---- monitoring-plugins-2.3.1.orig/plugins/check_mysql_query.c -+++ monitoring-plugins-2.3.1/plugins/check_mysql_query.c -@@ -33,6 +33,10 @@ const char *progname = "check_mysql_quer +--- monitoring-plugins-2.3.3.orig/plugins/check_mysql_query.c ++++ monitoring-plugins-2.3.3/plugins/check_mysql_query.c +@@ -33,6 +33,9 @@ const char *progname = "check_mysql_quer const char *copyright = "1999-2007"; const char *email = "de...@monitoring-plugins.org"; +/* The default port that MySQL servers listen on. */ +#define CHECK_PORT_DEFAULT 3306 + -+ #include "common.h" #include "utils.h" #include "utils_base.h" -@@ -48,7 +52,7 @@ char *db_pass = NULL; +@@ -48,7 +51,7 @@ char *db_pass = NULL; char *db = NULL; char *opt_file = NULL; char *opt_group = NULL; @@ -87,7 +84,7 @@ int process_arguments (int, char **); int validate_arguments (void); -@@ -299,7 +303,7 @@ void +@@ -299,7 +302,7 @@ void print_help (void) { char *myport; ++++++ monitoring-plugins-2.3.3-root-plugins-Makefile_-_no_chown.patch ++++++ Index: monitoring-plugins-2.3.3/plugins-root/Makefile.am =================================================================== --- monitoring-plugins-2.3.3.orig/plugins-root/Makefile.am +++ monitoring-plugins-2.3.3/plugins-root/Makefile.am @@ -49,7 +49,6 @@ INSTALL_SUID = \ p=$$f; \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \ - echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \ chown root $(DESTDIR)$(libexecdir)/$$p; \ echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \ chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \ @@ -64,7 +63,7 @@ install-exec-local: $(noinst_PROGRAMS) echo > $$TMPFILE; \ ## See if we can create a setuid root executable in $(libexecdir). ## If not, then don't even try to install setuid plugins. - can_create_suid_root_executable=no; \ + can_create_suid_root_executable=yes; \ chown root $$TMPFILE > /dev/null 2>&1 \ && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ && can_create_suid_root_executable=yes; \ ++++++ monitoring-plugins-2.3.3-wrong_percent_in_check_swap.patch ++++++ >From f3e6c9663369d011b241c6fb2c8fd5312f98cacf Mon Sep 17 00:00:00 2001 From: Jan ONDREJ <ondr...@salstar.sk> Date: Thu, 7 Oct 2010 17:28:48 +0400 Subject: [PATCH 6/6] Prevent check_swap from returning OK, if no swap activated My swap was not activated on boot for unknown reason and nagios does not report this as a problem. Here is an example: [root@kecom ~]# rpm -q nagios-plugins nagios-plugins-1.4.13-11.fc10.i386 [root@kecom ~]# /usr/lib/nagios/plugins/check_swap -w 80% -c 40% -c 1 -w 2 SWAP CRITICAL - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0 If there is no swap and users is trying to test percentage of free swap, consider 0 MB free swap space as problem, or of free/total raises division by zero, then set percentage to 0%, not to 100%. Steps to Reproduce: 1. make sure, your swap is empty or it's usage is not large 2. swapoff -a 3. /usr/lib/nagios/plugins/check_swap -w 80% -c 40% Actual results: SWAP OK - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0 Expected results: SWAP CRITICAL - 0% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0 Additional info: https://bugzilla.redhat.com/512559 Index: monitoring-plugins-2.3.3/plugins/check_swap.c =================================================================== --- monitoring-plugins-2.3.3.orig/plugins/check_swap.c +++ monitoring-plugins-2.3.3/plugins/check_swap.c @@ -137,7 +137,7 @@ main (int argc, char **argv) free_swap_mb += dskfree_mb; if (allswaps) { if (dsktotal_mb == 0) - percent=100.0; + percent= 0.0; else percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb)); result = max_state (result, check_swap (dskfree_mb, dsktotal_mb)); ++++++ monitoring-plugins-2.3.1.tar.gz -> monitoring-plugins-2.3.3.tar.gz ++++++ ++++ 71332 lines of diff (skipped) ++++++ monitoring-plugins-2.3.1.tar.gz.sha1 -> monitoring-plugins-2.3.3.tar.gz.sha1 ++++++ --- /work/SRC/openSUSE:Factory/monitoring-plugins/monitoring-plugins-2.3.1.tar.gz.sha1 2021-04-29 01:39:22.526661355 +0200 +++ /work/SRC/openSUSE:Factory/.monitoring-plugins.new.17445/monitoring-plugins-2.3.3.tar.gz.sha1 2023-11-01 22:10:23.244571883 +0100 @@ -1 +1 @@ -8cb4d72920ed99ff922b6989fe5213ea76b9388e *monitoring-plugins-2.3.1.tar.gz +4424d4ed0bfffa42b215ae4702a70adea968ad6d *monitoring-plugins-2.3.3.tar.gz ++++++ systemd-not-utmp.patch ++++++ --- monitoring-plugins-2.3.3.old/configure.ac 2023-02-01 14:40:55.000000000 +0100 +++ monitoring-plugins-2.3.3/configure.ac 2023-06-15 16:21:19.637049416 +0200 @@ -328,6 +328,25 @@ LIBS="$_SAVEDLIBS" ]) + +AC_ARG_WITH([systemd], [AS_HELP_STRING([--without-systemd], [Skips systemd support])]) + +dnl Check for libsystemd +AS_IF([test "x$with_systemd" != "xno"], [ + _SAVEDLIBS="$LIBS" + AC_CHECK_LIB(systemd,sd_get_sessions,,,-lsystemd) + if test "$ac_cv_lib_systemd_sd_get_sessions" = "yes"; then + SYSTEMDLIBS="-lsystemd" + SYSTEMDINCLUDE="" + AC_SUBST(SYSTEMDLIBS) + AC_SUBST(SYSTEMDINCLUDE) + else + AC_MSG_WARN([Skipping systemd support]) + fi + LIBS="$_SAVEDLIBS" +]) + + dnl Check for headers used by check_ide_smart case $host in *linux*) diff -wur monitoring-plugins-2.3.3.old/plugins/check_users.c monitoring-plugins-2.3.3/plugins/check_users.c --- monitoring-plugins-2.3.3.old/plugins/check_users.c 2023-02-01 14:40:55.000000000 +0100 +++ monitoring-plugins-2.3.3/plugins/check_users.c 2023-06-15 16:16:34.879700400 +0200 @@ -48,6 +48,11 @@ # include "popen.h" #endif +#ifdef HAVE_LIBSYSTEMD +#include <systemd/sd-daemon.h> +#include <systemd/sd-login.h> +#endif + #define possibly_set(a,b) ((a) == 0 ? (b) : 0) int process_arguments (int, char **); @@ -115,6 +120,11 @@ WTSFreeMemory(wtsinfo); #elif HAVE_UTMPX_H +#ifdef HAVE_LIBSYSTEMD + if (sd_booted () > 0) + users = sd_get_sessions (NULL); + else { +#endif /* get currently logged users from utmpx */ setutxent (); @@ -123,6 +133,9 @@ users++; endutxent (); +#ifdef HAVE_LIBSYSTEMD + } +#endif #else /* run the command */ child_process = spopen (WHO_COMMAND); Nur in monitoring-plugins-2.3.3/plugins: check_users.c~. diff -wur monitoring-plugins-2.3.3.old/plugins/Makefile.am monitoring-plugins-2.3.3/plugins/Makefile.am --- monitoring-plugins-2.3.3.old/plugins/Makefile.am 2023-02-01 14:40:55.000000000 +0100 +++ monitoring-plugins-2.3.3/plugins/Makefile.am 2023-06-15 16:23:36.925699810 +0200 @@ -112,7 +112,7 @@ check_time_LDADD = $(NETLIBS) check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS) check_ups_LDADD = $(NETLIBS) -check_users_LDADD = $(BASEOBJS) $(WTSAPI32LIBS) +check_users_LDADD = $(BASEOBJS) $(WTSAPI32LIBS) $(SYSTEMDLIBS) check_by_ssh_LDADD = $(NETLIBS) check_ide_smart_LDADD = $(BASEOBJS) negate_LDADD = $(BASEOBJS) ++++++ usr.lib.nagios.plugins.check_procs ++++++ --- /var/tmp/diff_new_pack.noQ4EA/_old 2023-11-01 22:10:25.672661831 +0100 +++ /var/tmp/diff_new_pack.noQ4EA/_new 2023-11-01 22:10:25.676661980 +0100 @@ -1,5 +1,5 @@ #include <tunables/global> -/usr/lib/nagios/plugins/check_procs { +/usr/lib/nagios/plugins/check_procs flags=(attach_disconnected) { #include <abstractions/nameservice> #include <abstractions/base> #include <abstractions/consoles> ++++++ usr.lib.nagios.plugins.check_procs.sle15 ++++++ --- /var/tmp/diff_new_pack.noQ4EA/_old 2023-11-01 22:10:25.692662572 +0100 +++ /var/tmp/diff_new_pack.noQ4EA/_new 2023-11-01 22:10:25.692662572 +0100 @@ -1,5 +1,5 @@ #include <tunables/global> -/usr/lib/nagios/plugins/check_procs { +/usr/lib/nagios/plugins/check_procs flags=(attach_disconnected) { #include <abstractions/nameservice> #include <abstractions/base> #include <abstractions/consoles>