Skip to content

Conversation

@orlitzky
Copy link
Contributor

@orlitzky orlitzky commented Feb 16, 2025

Currently, configure.ac performs checks for two programs,

  1. snmpget
  2. snmpgetnext

The second one is used by check_snmp only when a particular flag is passed, but in reality, snmpgetnext is still required because unless its PATH_TO_SNMPGETNEXT is defined, compilation of check_snmp.c will fail.

I have no idea how you might wind up with snmpget and not snmpgetnext, but at least one person has managed to do it and file a Gentoo bug about it. To fix the issue, this PR will disable the building of check_snmp if snmpgetnext is missing. It also emits a warning in that case.

Closes:

Not strictly required here, but the AS_IF macro is generally safer
because it handles (often unintentional) AC_REQUIRE calls.
PATH_TO_SNMPGETNEXT is used unconditionally in plugins/check_snmp.c,
and the build will fail if it is left undefined (that is, if we are
building check_snmp but snmpgetnext was neither found on the user's
PATH or supplied manually).

To avoid this build failure, we now test for snmpgetnext inside the
case for snmpget, and skip check_snmp unless BOTH are found.

Closes nagios-pluginsGH-788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant