diff options
| author | Sven Nierlein <sven@consol.de> | 2026-06-19 11:12:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-19 11:12:08 +0200 |
| commit | 1c84da06be317a00c667cb7d7f0c24b7e8feb89d (patch) | |
| tree | 95146c5762c6b6675d07aac55fe18cb8cc0a371f | |
| parent | 167be08c4be309b46a783f7b7172421437fafc6a (diff) | |
| download | monitoring-plugins-1c84da06be317a00c667cb7d7f0c24b7e8feb89d.tar.gz | |
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 <net-snmp/net-snmp-config.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 <sven@consol.de>
| -rw-r--r-- | configure.ac | 13 | ||||
| -rw-r--r-- | plugins/Makefile.am | 8 |
2 files changed, 17 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 4facfca2..41b39c7b 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -1445,6 +1445,19 @@ else | |||
| 1445 | AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) | 1445 | AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares]) |
| 1446 | fi | 1446 | fi |
| 1447 | 1447 | ||
| 1448 | AC_PATH_PROG(PATH_TO_NETSNMPCONFIG,net-snmp-config) | ||
| 1449 | AC_ARG_WITH(netsnmpconfig_command, | ||
| 1450 | ACX_HELP_STRING([--with-net-snmp-config-command=PATH], | ||
| 1451 | [sets path to net-snmp-config]), | ||
| 1452 | PATH_TO_NETSNMPCONFIG=$withval) | ||
| 1453 | if test -n "$PATH_TO_NETSNMPCONFIG" | ||
| 1454 | then | ||
| 1455 | AC_DEFINE_UNQUOTED(PATH_TO_NETSNMPCONFIG,"$PATH_TO_NETSNMPCONFIG",[path to net-snmp-config binary]) | ||
| 1456 | EXTRAS="$EXTRAS check_snmp" | ||
| 1457 | else | ||
| 1458 | AC_MSG_WARN([Install net-snmp-config to build check_snmp]) | ||
| 1459 | fi | ||
| 1460 | |||
| 1448 | AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) | 1461 | AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) |
| 1449 | AC_ARG_WITH(snmpget_command, | 1462 | AC_ARG_WITH(snmpget_command, |
| 1450 | ACX_HELP_STRING([--with-snmpget-command=PATH], | 1463 | ACX_HELP_STRING([--with-snmpget-command=PATH], |
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 2bea8fc0..326e4b3a 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am | |||
| @@ -36,8 +36,7 @@ libexec_PROGRAMS = check_apt check_cluster check_disk check_dummy check_http che | |||
| 36 | check_mrtg check_mrtgtraf check_ntp_peer check_ping \ | 36 | check_mrtg check_mrtgtraf check_ntp_peer check_ping \ |
| 37 | check_real check_smtp check_ssh check_tcp check_time check_ntp_time \ | 37 | check_real check_smtp check_ssh check_tcp check_time check_ntp_time \ |
| 38 | check_ups check_users negate \ | 38 | check_ups check_users negate \ |
| 39 | urlize @EXTRAS@ \ | 39 | urlize @EXTRAS@ |
| 40 | check_snmp | ||
| 41 | 40 | ||
| 42 | check_tcp_programs = check_ftp check_imap check_nntp check_pop \ | 41 | check_tcp_programs = check_ftp check_imap check_nntp check_pop \ |
| 43 | check_udp check_clamd @check_tcp_ssl@ | 42 | check_udp check_clamd @check_tcp_ssl@ |
| @@ -46,6 +45,7 @@ EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_hpjd \ | |||
| 46 | check_swap check_fping check_ldap check_game check_dig \ | 45 | check_swap check_fping check_ldap check_game check_dig \ |
| 47 | check_nagios check_by_ssh check_dns check_ide_smart \ | 46 | check_nagios check_by_ssh check_dns check_ide_smart \ |
| 48 | check_procs check_mysql_query check_apt check_dbi check_curl \ | 47 | check_procs check_mysql_query check_apt check_dbi check_curl \ |
| 48 | check_snmp \ | ||
| 49 | \ | 49 | \ |
| 50 | tests/test_check_swap \ | 50 | tests/test_check_swap \ |
| 51 | tests/test_check_snmp \ | 51 | tests/test_check_snmp \ |
| @@ -165,8 +165,8 @@ check_radius_LDADD = $(NETLIBS) $(RADIUSLIBS) | |||
| 165 | check_real_LDADD = $(NETLIBS) | 165 | check_real_LDADD = $(NETLIBS) |
| 166 | check_snmp_SOURCES = check_snmp.c check_snmp.d/check_snmp_helpers.c | 166 | check_snmp_SOURCES = check_snmp.c check_snmp.d/check_snmp_helpers.c |
| 167 | check_snmp_LDADD = $(BASEOBJS) | 167 | check_snmp_LDADD = $(BASEOBJS) |
| 168 | check_snmp_LDFLAGS = $(AM_LDFLAGS) -lm `net-snmp-config --libs` | 168 | check_snmp_LDFLAGS = $(AM_LDFLAGS) -lm `$(PATH_TO_NETSNMPCONFIG) --libs` |
| 169 | check_snmp_CFLAGS = $(AM_CFLAGS) `net-snmp-config --cflags | sed 's/-Werror=declaration-after-statement//'` | 169 | check_snmp_CFLAGS = $(AM_CFLAGS) `$(PATH_TO_NETSNMPCONFIG) --cflags | sed 's/-Werror=declaration-after-statement//'` |
| 170 | check_smtp_LDADD = $(SSLOBJS) | 170 | check_smtp_LDADD = $(SSLOBJS) |
| 171 | check_ssh_LDADD = $(NETLIBS) | 171 | check_ssh_LDADD = $(NETLIBS) |
| 172 | check_swap_SOURCES = check_swap.c check_swap.d/swap.c | 172 | check_swap_SOURCES = check_swap.c check_swap.d/swap.c |
