even more better way to disable snmp
This commit is contained in:
parent
2d4e3ffaf6
commit
ce4f26b134
@ -1,5 +1,8 @@
|
|||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
/* enable Net-SNMP */
|
||||||
|
#undef ENABLE_NETSNMP
|
||||||
|
|
||||||
/* enable stats */
|
/* enable stats */
|
||||||
#undef ENABLE_STATS
|
#undef ENABLE_STATS
|
||||||
|
|
||||||
@ -51,9 +54,6 @@
|
|||||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||||
#undef HAVE_LIBRESOLV
|
#undef HAVE_LIBRESOLV
|
||||||
|
|
||||||
/* have libsnmp */
|
|
||||||
#undef HAVE_LIBSNMP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||||
#undef HAVE_LIBSOCKET
|
#undef HAVE_LIBSOCKET
|
||||||
|
|
||||||
|
6
smmapdfw/configure
vendored
6
smmapdfw/configure
vendored
@ -19430,11 +19430,11 @@ fi
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HAVE_LIBSNMP=0
|
ENABLE_NETSNMP=0
|
||||||
if test "x$WITHOUT_NETSNMP" = "x0"; then
|
if test "x$WITHOUT_NETSNMP" = "x0"; then
|
||||||
NETSNMP_LIBS=`net-snmp-config --netsnmp-agent-libs`
|
NETSNMP_LIBS=`net-snmp-config --netsnmp-agent-libs`
|
||||||
LIBS="$LIBS $NETSNMP_LIBS"
|
LIBS="$LIBS $NETSNMP_LIBS"
|
||||||
HAVE_LIBSNMP=1
|
ENABLE_NETSNMP=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -21427,7 +21427,7 @@ _ACEOF
|
|||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
#define HAVE_LIBSNMP ${HAVE_LIBSNMP}
|
#define ENABLE_NETSNMP ${ENABLE_NETSNMP}
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,11 +197,11 @@ if test "x$WITHOUT_DJBDNS" = "x0"; then
|
|||||||
AC_CHECK_LIB([djbdns], [dns_transmit_start])
|
AC_CHECK_LIB([djbdns], [dns_transmit_start])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HAVE_LIBSNMP=0
|
ENABLE_NETSNMP=0
|
||||||
if test "x$WITHOUT_NETSNMP" = "x0"; then
|
if test "x$WITHOUT_NETSNMP" = "x0"; then
|
||||||
NETSNMP_LIBS=`net-snmp-config --netsnmp-agent-libs`
|
NETSNMP_LIBS=`net-snmp-config --netsnmp-agent-libs`
|
||||||
LIBS="$LIBS $NETSNMP_LIBS"
|
LIBS="$LIBS $NETSNMP_LIBS"
|
||||||
HAVE_LIBSNMP=1
|
ENABLE_NETSNMP=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ fi
|
|||||||
|
|
||||||
AC_DEFINE_UNQUOTED(ENABLE_VERIFY_CACHE, ${ENABLE_VERIFY_CACHE}, [enable verify cache])
|
AC_DEFINE_UNQUOTED(ENABLE_VERIFY_CACHE, ${ENABLE_VERIFY_CACHE}, [enable verify cache])
|
||||||
AC_DEFINE_UNQUOTED(ENABLE_STATS, ${ENABLE_STATS}, [enable stats])
|
AC_DEFINE_UNQUOTED(ENABLE_STATS, ${ENABLE_STATS}, [enable stats])
|
||||||
AC_DEFINE_UNQUOTED(HAVE_LIBSNMP, ${HAVE_LIBSNMP}, [have libsnmp])
|
AC_DEFINE_UNQUOTED(ENABLE_NETSNMP, ${ENABLE_NETSNMP}, [enable Net-SNMP])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ pthread_t cleanerThread;
|
|||||||
pthread_t statsThread;
|
pthread_t statsThread;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_LIBSNMP==1
|
#if ENABLE_NETSNMP==1
|
||||||
pthread_t snmpThread;
|
pthread_t snmpThread;
|
||||||
#endif
|
#endif
|
||||||
count_t thread_counter;
|
count_t thread_counter;
|
||||||
@ -120,7 +120,7 @@ void * statser(void * arg) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_LIBSNMP==1
|
#if ENABLE_NETSNMP==1
|
||||||
void * snmper(void * arg) {
|
void * snmper(void * arg) {
|
||||||
snmp_subagent_main();
|
snmp_subagent_main();
|
||||||
}
|
}
|
||||||
@ -307,13 +307,13 @@ int server() {
|
|||||||
}
|
}
|
||||||
#endif /* ENABLE_STATS */
|
#endif /* ENABLE_STATS */
|
||||||
|
|
||||||
#if HAVE_LIBSNMP==1
|
#if ENABLE_NETSNMP==1
|
||||||
enableSnmp = atoi(findcfgx(cfg, "global", "enable_snmp", "0"));
|
enableSnmp = atoi(findcfgx(cfg, "global", "enable_snmp", "0"));
|
||||||
if (enableSnmp) {
|
if (enableSnmp) {
|
||||||
syslog(LOG_INFO, "server: starting snmp subagent thread");
|
syslog(LOG_INFO, "server: starting snmp subagent thread");
|
||||||
pthread_create(&snmpThread, NULL, &snmper, NULL);
|
pthread_create(&snmpThread, NULL, &snmper, NULL);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_LIBSNMP */
|
#endif /* ENABLE_NETSNMP */
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
syslog(LOG_DEBUG, "server: Waiting for connection");
|
syslog(LOG_DEBUG, "server: Waiting for connection");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBSNMP
|
#if ENABLE_NETSNMP==1
|
||||||
#include <net-snmp/net-snmp-config.h>
|
#include <net-snmp/net-snmp-config.h>
|
||||||
#include <net-snmp/net-snmp-includes.h>
|
#include <net-snmp/net-snmp-includes.h>
|
||||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBSNMP
|
#if ENABLE_NETSNMP==1
|
||||||
void snmp_subagent_main();
|
void snmp_subagent_main();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user