From 1c84da06be317a00c667cb7d7f0c24b7e8feb89d Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Fri, 19 Jun 2026 11:12:08 +0200 Subject: check for net-snmp-config when buildin check_snmp (fixes #2281) (#2286) this will fix the build error on check_snmp when net-snmp-config is not available. ``` CC check_snmp-check_snmp.o /bin/bash: line 1: net-snmp-config: command not found In file included from check_snmp.d/check_snmp_helpers.h:3, from check_snmp.c:42: check_snmp.d/./config.h:16:10: fatal error: net-snmp/net-snmp-config.h: No such file or directory 16 | #include | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[3]: *** [Makefile:3353: check_snmp-check_snmp.o] Error 1 make[3]: Leaving directory '/opt/projects/git/monitoring-plugins/plugins' ``` Signed-off-by: Sven Nierlein --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 4facfca2..41b39c7b 100644 --- a/configure.ac +++ b/configure.ac @@ -1445,6 +1445,19 @@ else AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) fi +AC_PATH_PROG(PATH_TO_NETSNMPCONFIG,net-snmp-config) +AC_ARG_WITH(netsnmpconfig_command, + ACX_HELP_STRING([--with-net-snmp-config-command=PATH], + [sets path to net-snmp-config]), + PATH_TO_NETSNMPCONFIG=$withval) +if test -n "$PATH_TO_NETSNMPCONFIG" +then + AC_DEFINE_UNQUOTED(PATH_TO_NETSNMPCONFIG,"$PATH_TO_NETSNMPCONFIG",[path to net-snmp-config binary]) + EXTRAS="$EXTRAS check_snmp" +else + AC_MSG_WARN([Install net-snmp-config to build check_snmp]) +fi + AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) AC_ARG_WITH(snmpget_command, ACX_HELP_STRING([--with-snmpget-command=PATH], -- cgit v1.2.3-74-g34f1