diff options
Diffstat (limited to 'net-mgmt/monitoring-plugins/files')
6 files changed, 56 insertions, 207 deletions
diff --git a/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__ircd.pl b/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__ircd.pl index 0cd1a4951128..04fc37d4920a 100644 --- a/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__ircd.pl +++ b/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__ircd.pl @@ -1,6 +1,6 @@ ---- plugins-scripts/check_ircd.pl.orig 2016-11-29 08:45:08 UTC -+++ plugins-scripts/check_ircd.pl -@@ -65,6 +65,7 @@ sub bindRemote ($$); +--- plugins-scripts/check_ircd.pl.orig 2025-11-08 16:25:06.105511000 +0100 ++++ plugins-scripts/check_ircd.pl 2025-11-08 16:27:22.763542000 +0100 +@@ -65,6 +65,7 @@ $ENV{'ENV'}=''; $ENV{'PATH'}='@TRUSTED_PATH@'; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; @@ -8,12 +8,3 @@ # -----------------------------------------------------------------[ Global ]-- -@@ -152,7 +153,7 @@ sub bindRemote ($$) - print "IRCD UNKNOWN: Could not start socket ($!)\n"; - exit $ERRORS{"UNKNOWN"}; - } -- $sockaddr = 'S n a4 x8'; -+ $sockaddr = 'x C n a4 x8'; - $that = pack($sockaddr, AF_INET, $in_remoteport, $thataddr); - if (!connect(ClientSocket, $that)) { - print "IRCD UNKNOWN: Could not connect socket ($!)\n"; diff --git a/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__mailq.pl b/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__mailq.pl index 4274663ddb21..fc244ca94d41 100644 --- a/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__mailq.pl +++ b/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__mailq.pl @@ -1,56 +1,51 @@ -From 94acff9f2616fbca8fd31292d374d9ce8a45263a Mon Sep 17 00:00:00 2001 -From: Filias Heidt <fh@netzkommune.de> -Date: Fri, 9 Jun 2017 14:46:00 +0200 -Subject: [PATCH] add support for opensmtpd - ---- plugins-scripts/check_mailq.pl.orig 2020-12-09 21:38:01 UTC -+++ plugins-scripts/check_mailq.pl -@@ -550,6 +550,39 @@ elsif ( $mailq eq "nullmailer" ) { - } +--- plugins-scripts/check_mailq.pl.orig 2025-11-08 16:31:19.283295000 +0100 ++++ plugins-scripts/check_mailq.pl 2025-11-08 16:39:40.042634000 +0100 +@@ -571,7 +571,39 @@ elsif ( $mailq eq "nullmailer" ) { + $state = $ERRORS{'CRITICAL'}; + } } # end of ($mailq eq "nullmailer") - -+elsif ( $mailq eq "opensmtp" ) { -+ ## open mailq -+ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { -+ if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { -+ print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; -+ exit $ERRORS{'UNKNOWN'}; -+ } -+ }elsif( defined $utils::PATH_TO_MAILQ){ -+ unless (-x $utils::PATH_TO_MAILQ) { -+ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; -+ exit $ERRORS{'UNKNOWN'}; -+ } -+ } else { -+ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; -+ exit $ERRORS{'UNKNOWN'}; -+ } + -+ $msg_q++ while (<MAILQ>); ++elsif ( $mailq eq "opensmtp" ) { ++ ## open mailq ++ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { ++ if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { ++ print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; ++ exit $ERRORS{'UNKNOWN'}; ++ } ++ }elsif( defined $utils::PATH_TO_MAILQ){ ++ unless (-x $utils::PATH_TO_MAILQ) { ++ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; ++ exit $ERRORS{'UNKNOWN'}; ++ } ++ } else { ++ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; ++ exit $ERRORS{'UNKNOWN'}; ++ } + -+ close(MAILQ) ; -+ if ($msg_q < $opt_w) { -+ $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; -+ $state = $ERRORS{'OK'}; -+ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { -+ $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; -+ $state = $ERRORS{'WARNING'}; -+ }else { -+ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; -+ $state = $ERRORS{'CRITICAL'}; -+ } ++ $msg_q++ while (<MAILQ>); + ++ close(MAILQ) ; ++ if ($msg_q < $opt_w) { ++ $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; ++ $state = $ERRORS{'OK'}; ++ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { ++ $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; ++ $state = $ERRORS{'WARNING'}; ++ }else { ++ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; ++ $state = $ERRORS{'CRITICAL'}; ++ } +} # end of ($mailq eq "opensmtp") + -+ # Perfdata support print "$msg|unsent=$msg_q;$opt_w;$opt_c;0\n"; exit $state; -@@ -612,7 +645,7 @@ sub process_arguments(){ - } +@@ -635,7 +667,7 @@ sub process_arguments(){ + } - if (defined $opt_M) { -- if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer)$/) { -+ if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer|opensmtp)$/) { - $mailq = $opt_M ; - }elsif( $opt_M eq ''){ - $mailq = 'sendmail'; + if (defined $opt_M) { +- if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer)$/) { ++ if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer|opensmtp)$/) { + $mailq = $opt_M ; + }elsif( $opt_M eq ''){ + $mailq = 'sendmail'; diff --git a/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c b/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c index ce072578398b..a96b08af9a54 100644 --- a/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c +++ b/net-mgmt/monitoring-plugins/files/patch-plugins_check__http.c @@ -1,17 +1,17 @@ -diff --git a/plugins/check_http.c b/plugins/check_http.c ---- plugins/check_http.c.old -+++ plugins/check_http.c -@@ -1462,7 +1462,13 @@ char *unchunk_content(const char *content) { - memcpy(result + (overall_size - size_of_chunk), start_of_chunk, size_of_chunk); - } - -- result[overall_size] = '\0'; -+ if (overall_size == 0 && result == NULL) { +--- plugins/check_http.c.orig 2025-11-08 16:43:35.500239000 +0100 ++++ plugins/check_http.c 2025-11-08 17:09:19.591784000 +0100 +@@ -1476,7 +1476,13 @@ char *unchunk_content(const char *content) { + result = calloc(1, sizeof(char)); + // No error handling here, we can only return NULL anyway + } else { +- result[overall_size] = '\0'; ++ if (overall_size == 0 && result == NULL) { + // We might just have received the end chunk without previous content, so result is never allocated + result = calloc(1, sizeof(char)); + // No error handling here, we can only return NULL anyway + } else { -+ result[overall_size] = '\0'; -+ } ++ result[overall_size] = '\0'; ++ } + } return result; } diff --git a/net-mgmt/monitoring-plugins/files/patch-plugins_check__procs.c b/net-mgmt/monitoring-plugins/files/patch-plugins_check__procs.c deleted file mode 100644 index c74d61575410..000000000000 --- a/net-mgmt/monitoring-plugins/files/patch-plugins_check__procs.c +++ /dev/null @@ -1,107 +0,0 @@ ---- plugins/check_procs.c.orig 2022-10-19 12:50:27 UTC -+++ plugins/check_procs.c -@@ -70,6 +70,7 @@ int options = 0; /* bitmask of filter criteria to test - #define PCPU 256 - #define ELAPSED 512 - #define EREG_ARGS 1024 -+#define JID 2048 - - #define KTHREAD_PARENT "kthreadd" /* the parent process of kernel threads: - ppid of procs are compared to pid of this proc*/ -@@ -101,6 +102,7 @@ int usepid = 0; /* whether to test for pid or /proc/pi - char tmp[MAX_INPUT_BUFFER]; - int kthread_filter = 0; - int usepid = 0; /* whether to test for pid or /proc/pid/exe */ -+int jid; - - FILE *ps_input = NULL; - -@@ -130,6 +132,7 @@ main (int argc, char **argv) - int procuid = 0; - pid_t procpid = 0; - pid_t procppid = 0; -+ int procjid = 0; - pid_t kthread_ppid = 0; - int procvsz = 0; - int procrss = 0; -@@ -230,9 +233,9 @@ main (int argc, char **argv) - procseconds = convert_to_seconds(procetime); - - if (verbose >= 3) -- printf ("proc#=%d uid=%d vsz=%d rss=%d pid=%d ppid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n", -+ printf ("proc#=%d uid=%d vsz=%d rss=%d pid=%d ppid=%d jid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n", - procs, procuid, procvsz, procrss, -- procpid, procppid, procpcpu, procstat, -+ procpid, procppid, procjid, procpcpu, procstat, - procetime, procprog, procargs); - - /* Ignore self */ -@@ -275,6 +278,8 @@ main (int argc, char **argv) - resultsum |= PROG; - if ((options & PPID) && (procppid == ppid)) - resultsum |= PPID; -+ if ((options & JID) && (procjid == jid)) -+ resultsum |= JID; - if ((options & USER) && (procuid == uid)) - resultsum |= USER; - if ((options & VSZ) && (procvsz >= vsz)) -@@ -292,9 +297,9 @@ main (int argc, char **argv) - - procs++; - if (verbose >= 2) { -- printf ("Matched: uid=%d vsz=%d rss=%d pid=%d ppid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n", -+ printf ("Matched: uid=%d vsz=%d rss=%d pid=%d ppid=%d jid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n", - procuid, procvsz, procrss, -- procpid, procppid, procpcpu, procstat, -+ procpid, procppid, procjid, procpcpu, procstat, - procetime, procprog, procargs); - } - -@@ -409,6 +414,7 @@ process_arguments (int argc, char **argv) - {"input-file", required_argument, 0, CHAR_MAX+2}, - {"no-kthreads", required_argument, 0, 'k'}, - {"traditional-filter", no_argument, 0, 'T'}, -+ {"jid", required_argument, 0, 'j'}, - {0, 0, 0, 0} - }; - -@@ -417,7 +423,7 @@ process_arguments (int argc, char **argv) - strcpy (argv[c], "-t"); - - while (1) { -- c = getopt_long (argc, argv, "Vvhkt:c:w:p:s:u:C:a:z:r:m:P:T", -+ c = getopt_long (argc, argv, "Vvhkt:c:w:p:s:u:C:a:z:r:m:P:Tj:", - longopts, &option); - - if (c == -1 || c == EOF) -@@ -451,6 +457,12 @@ process_arguments (int argc, char **argv) - break; - } - usage4 (_("Parent Process ID must be an integer!")); -+ case 'j': /* jail id */ -+ if (sscanf (optarg, "%d%[^0-9]", &jid, tmp) == 1) { -+ asprintf (&fmt, "%s%sJID = %d", (fmt ? fmt : "") , (options ? ", " : ""), jid); -+ options |= JID; -+ break; -+ } - case 's': /* status */ - if (statopts) - break; -@@ -731,6 +743,8 @@ print_help (void) - printf (" %s\n", _("RSZDT, plus others based on the output of your 'ps' command).")); - printf (" %s\n", "-p, --ppid=PPID"); - printf (" %s\n", _("Only scan for children of the parent process ID indicated.")); -+ printf (" %s\n", "-j, --jid=JID"); -+ printf (" %s\n", _("Only scan for process running in jail which ID is JID.")); - printf (" %s\n", "-z, --vsz=VSZ"); - printf (" %s\n", _("Only scan for processes with VSZ higher than indicated.")); - printf (" %s\n", "-r, --rss=RSS"); -@@ -784,7 +798,7 @@ print_usage (void) - print_usage (void) - { - printf ("%s\n", _("Usage:")); -- printf ("%s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n", progname); -+ printf ("%s -w <range> -c <range> [-m metric] [-s state] [-p ppid] [-j jid]\n", progname); - printf (" [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n"); - printf (" [-C command] [-k] [-t timeout] [-v]\n"); - } diff --git a/net-mgmt/monitoring-plugins/files/patch-plugins_check__ssh.c b/net-mgmt/monitoring-plugins/files/patch-plugins_check__ssh.c deleted file mode 100644 index 14b1ae8ab9ae..000000000000 --- a/net-mgmt/monitoring-plugins/files/patch-plugins_check__ssh.c +++ /dev/null @@ -1,18 +0,0 @@ ---- plugins/check_ssh.c.orig 2016-11-29 08:45:08 UTC -+++ plugins/check_ssh.c -@@ -255,6 +255,7 @@ ssh_connect (char *haddr, int hport, cha - printf - (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"), - ssh_server, ssh_proto, remote_version); -+ recv (sd, output, BUFF_SZ, 0); - close(sd); - exit (STATE_CRITICAL); - } -@@ -273,6 +274,7 @@ ssh_connect (char *haddr, int hport, cha - (_("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)); -+ recv (sd, output, BUFF_SZ, 0); - close(sd); - exit (STATE_OK); - } diff --git a/net-mgmt/monitoring-plugins/files/patch-plugins_check__swap.c b/net-mgmt/monitoring-plugins/files/patch-plugins_check__swap.c deleted file mode 100644 index 4c534bcdbed1..000000000000 --- a/net-mgmt/monitoring-plugins/files/patch-plugins_check__swap.c +++ /dev/null @@ -1,12 +0,0 @@ ---- plugins/check_swap.c.orig 2023-03-19 09:10:16.525073000 +0100 -+++ plugins/check_swap.c 2023-03-19 09:10:31.862180000 +0100 -@@ -34,9 +34,6 @@ const char *email = "devel@monitoring-plugins.org"; - #include "common.h" - #include "popen.h" - #include "utils.h" --#include <string.h> --#include <math.h> --#include <libintl.h> - - #ifdef HAVE_DECL_SWAPCTL - # ifdef HAVE_SYS_PARAM_H |
