update monitoring-plugins to a new post-rc checkout, bringing in some

reliability patches for check_icmp. adjust configure args to fix fping
flags. reworked from a diff by Alvar Penning.
This commit is contained in:
sthen
2026-01-20 13:22:27 +00:00
parent fed2baf92a
commit 14902489d9
7 changed files with 18 additions and 74 deletions
+4 -5
View File
@@ -8,12 +8,12 @@ COMMENT-pgsql= postgresql monitoring plugin
COMMENT-snmp= monitoring plugins using snmp
COMMENT-radius= RADIUS monitoring plugin
V= 3.0.0rc2
V= 3.0.0rc2pl1
#SITES= https://www.monitoring-plugins.org/download/
GH_ACCOUNT= monitoring-plugins
GH_PROJECT= monitoring-plugins
GH_TAGNAME= v${V:S/rc/-rc/}
REVISION-main= 0
#GH_TAGNAME= v${V:S/rc/-rc/}
GH_COMMIT= bccb38dc9d56ca5cecce8f2f9a988ec5d31626db
DISTNAME= monitoring-plugins-${V:S/rc/-rc/}
PKGNAME-main= monitoring-plugins-$V
@@ -58,8 +58,7 @@ CONFIGURE_ARGS+= \
# proot on a nosuid filesystem can't run ping)
CONFIGURE_ARGS+= \
--with-dig-command=/usr/bin/dig \
--with-fping-command="${LOCALBASE}/sbin/fping -4" \
--with-fping6-command="${LOCALBASE}/sbin/fping -6" \
--with-fping-command="${LOCALBASE}/sbin/fping" \
--with-nslookup-command=/usr/bin/nslookup \
--with-ping-command="/sbin/ping -n -c %d %s" \
--with-ping6-command="/sbin/ping6 -n -c %d %s" \
+2 -2
View File
@@ -1,2 +1,2 @@
SHA256 (monitoring-plugins-3.0.0-rc2.tar.gz) = 62/DdpFbegYDIXdtx3fxru366HTZ8PkYbDRhztdtipc=
SIZE (monitoring-plugins-3.0.0-rc2.tar.gz) = 2588453
SHA256 (monitoring-plugins-3.0.0-rc2pl1-bccb38dc.tar.gz) = Q3ikEB85sdOjJd2L8MBeoy0ckH4VTdgf1on9h45Tpgk=
SIZE (monitoring-plugins-3.0.0-rc2pl1-bccb38dc.tar.gz) = 2590494
@@ -1,17 +0,0 @@
From 3e8cef3721533b124a765f7f320312434611afc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lorenz=20K=C3=A4stle?= <lorenz.kaestle@netways.de>
Date: Wed, 14 Jan 2026 17:28:51 +0100
Subject: [PATCH] Compute numbers in output summary correctly
Index: lib/output.c
--- lib/output.c.orig
+++ lib/output.c
@@ -175,7 +175,7 @@ char *get_subcheck_summary(mp_check check) {
unsigned int critical = 0;
unsigned int unknown = 0;
while (subchecks != NULL) {
- switch (subchecks->subcheck.state) {
+ switch (mp_compute_subcheck_state(subchecks->subcheck)) {
case STATE_OK:
ok++;
break;
@@ -6,7 +6,7 @@ on OpenBSD, time_t is always 64-bit, even on 32-bit archs.
Index: plugins-root/check_icmp.c
--- plugins-root/check_icmp.c.orig
+++ plugins-root/check_icmp.c
@@ -941,15 +941,15 @@ int main(int argc, char **argv) {
@@ -940,15 +940,15 @@ int main(int argc, char **argv) {
if (debug) {
if (max_completion_time > (timeout * 1000000)) {
@@ -27,7 +27,7 @@ Index: plugins-root/check_icmp.c
printf("icmp_pkt_size: %u timeout: %u\n", config.icmp_data_size + ICMP_MINLEN, timeout);
}
@@ -1050,8 +1050,8 @@ static void run_checks(unsigned short icmp_pkt_size, t
@@ -1049,8 +1049,8 @@ static void run_checks(unsigned short icmp_pkt_size, t
time_t final_wait = max_completion_time - time_passed;
if (debug) {
@@ -38,7 +38,7 @@ Index: plugins-root/check_icmp.c
}
if (time_passed > max_completion_time) {
if (debug) {
@@ -1063,7 +1063,7 @@ static void run_checks(unsigned short icmp_pkt_size, t
@@ -1062,7 +1062,7 @@ static void run_checks(unsigned short icmp_pkt_size, t
/* catch the packets that might come in within the timeframe, but
* haven't yet */
if (debug) {
@@ -47,7 +47,7 @@ Index: plugins-root/check_icmp.c
(float)final_wait / 1000);
}
if (targets_alive(number_of_targets, program_state->targets_down) ||
@@ -1126,7 +1126,7 @@ static int wait_for_reply(check_icmp_socket_set sockse
@@ -1125,7 +1125,7 @@ static int wait_for_reply(check_icmp_socket_set sockse
&loop_time_interval, &packet_received_timestamp);
if (!recv_foo.received) {
if (debug > 1) {
@@ -1,16 +1,17 @@
net-snmp-config --cflags returns the flags used to compile Net-SNMP,
not just the flags which downstreams should use.
not just the flags which downstreams should use. use pkg-config instead.
(needed for net-snmp 5.9.5.2 which uses Werror=declaration-after-statement
because check_snmp.c is not at all clean for this. should be filtered out
by net-snmp-config in subsequent versions).
Index: plugins/Makefile.am
--- plugins/Makefile.am.orig
+++ plugins/Makefile.am
@@ -164,8 +164,8 @@ check_radius_LDADD = $(NETLIBS) $(RADIUSLIBS)
check_real_LDADD = $(NETLIBS)
@@ -166,7 +166,7 @@ check_real_LDADD = $(NETLIBS)
check_snmp_SOURCES = check_snmp.c check_snmp.d/check_snmp_helpers.c
check_snmp_LDADD = $(BASEOBJS)
-check_snmp_LDFLAGS = $(AM_LDFLAGS) `net-snmp-config --libs`
check_snmp_LDFLAGS = $(AM_LDFLAGS) -lm `net-snmp-config --libs`
-check_snmp_CFLAGS = $(AM_CFLAGS) `net-snmp-config --cflags`
+check_snmp_LDFLAGS = $(AM_LDFLAGS) `pkg-config --libs netsnmp`
+check_snmp_CFLAGS = $(AM_CFLAGS) `pkg-config --cflags netsnmp`
check_smtp_LDADD = $(SSLOBJS)
check_ssh_LDADD = $(NETLIBS)
@@ -1,39 +0,0 @@
https://github.com/monitoring-plugins/monitoring-plugins/pull/2211
these are uint64_t (plugins/check_disk.d/utils_disk.h struct parameter_list)
https://github.com/monitoring-plugins/monitoring-plugins/pull/2223
Index: plugins/check_disk.c
--- plugins/check_disk.c.orig
+++ plugins/check_disk.c
@@ -263,8 +263,8 @@ int main(int argc, char **argv) {
*filesystem = get_path_stats(*filesystem, fsp, config.freespace_ignore_reserved);
if (verbose >= 3) {
- printf("For %s, used_units=%lu free_units=%lu total_units=%lu "
- "fsp.fsu_blocksize=%lu\n",
+ printf("For %s, used_units=%llu free_units=%llu total_units=%llu "
+ "fsp.fsu_blocksize=%ju\n",
mount_entry->me_mountdir, filesystem->used_bytes, filesystem->free_bytes,
filesystem->total_bytes, fsp.fsu_blocksize);
}
@@ -1262,6 +1262,10 @@ mp_subcheck evaluate_filesystem(measurement_unit measu
double free_inode_percentage =
calculate_percent(measurement_unit.inodes_free, measurement_unit.inodes_total);
+ mp_perfdata inode_percentage_pd = perfdata_init();
+ inode_percentage_pd = mp_set_pd_value(inode_percentage_pd, free_inode_percentage);
+ inode_percentage_pd = mp_pd_set_thresholds(inode_percentage_pd, measurement_unit.freeinodes_percent_thresholds);
+
if (verbose > 0) {
printf("free inode percentage computed: %g\n", free_inode_percentage);
}
@@ -1293,7 +1297,7 @@ mp_subcheck evaluate_filesystem(measurement_unit measu
inodes_pd = mp_pd_set_thresholds(inodes_pd, absolut_inode_thresholds);
freeindodes_percent_sc =
- mp_set_subcheck_state(freeindodes_percent_sc, mp_get_pd_status(inodes_pd));
+ mp_set_subcheck_state(freeindodes_percent_sc, mp_get_pd_status(inode_percentage_pd));
if (display_inodes_perfdata) {
mp_add_perfdata_to_subcheck(&freeindodes_percent_sc, inodes_pd);
}
@@ -6,7 +6,7 @@ on OpenBSD, time_t is always 64-bit, even on 32-bit archs.
Index: plugins/check_snmp.d/check_snmp_helpers.c
--- plugins/check_snmp.d/check_snmp_helpers.c.orig
+++ plugins/check_snmp.d/check_snmp_helpers.c
@@ -668,7 +668,7 @@ void np_state_write_string(state_key stateKey, time_t
@@ -670,7 +670,7 @@ void np_state_write_string(state_key stateKey, time_t
fprintf(temp_file_pointer, "# NP State file\n");
fprintf(temp_file_pointer, "%d\n", NP_STATE_FORMAT_VERSION);
fprintf(temp_file_pointer, "%d\n", stateKey.data_version);
@@ -15,7 +15,7 @@ Index: plugins/check_snmp.d/check_snmp_helpers.c
fprintf(temp_file_pointer, "%s\n", stringToStore);
fchmod(temp_file_desc, S_IRUSR | S_IWUSR | S_IRGRP);
@@ -752,7 +752,7 @@ bool _np_state_read_file(FILE *state_file, state_key s
@@ -754,7 +754,7 @@ bool _np_state_read_file(FILE *state_file, state_key s
} break;
case STATE_DATA_TIME: {
/* If time > now, error */