snmp_agent plugin: Don't export the g_agent variable.
[collectd.git] / configure.ac
index 2d7f3e2..efa54c5 100644 (file)
@@ -3643,6 +3643,7 @@ AC_SUBST([LIBNETAPP_LIBS])
 # }}}
 
 # --with-libnetsnmp {{{
+with_libnetsnmpagent="no"
 AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
 [
        if test "x$withval" = "xno"
@@ -3655,6 +3656,7 @@ AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Pat
                with_libnetsnmp_cppflags="-I$withval/include"
                with_libnetsnmp_ldflags="-I$withval/lib"
                with_libnetsnmp="yes"
+               with_libnetsnmpagent="yes"
        fi; fi
 ],
 [with_libnetsnmp="yes"])
@@ -3667,6 +3669,10 @@ then
       [with_libnetsnmp="yes"],
       [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"]
     )
+    AC_CHECK_HEADERS(net-snmp/agent/agent_module_config.h,
+      [],
+      [with_libnetsnmpagent="no (net-snmp/agent/agent_module_config.h not found)"]
+    )
 
        CPPFLAGS="$SAVE_CPPFLAGS"
 fi
@@ -3680,6 +3686,11 @@ then
                [with_libnetsnmp="no (libnetsnmp not found)"],
                [$with_snmp_libs])
 
+       AC_CHECK_LIB(netsnmpagent, init_agent,
+               [with_libnetsnmpagent="yes"],
+               [with_libnetsnmpagent="no (libnetsnmpagent not found)"],
+               [$with_snmp_libs])
+
        LDFLAGS="$SAVE_LDFLAGS"
 fi
 if test "x$with_libnetsnmp" = "xyes"
@@ -3688,6 +3699,10 @@ then
        BUILD_WITH_LIBNETSNMP_LDFLAGS="$with_libnetsnmp_ldflags"
        BUILD_WITH_LIBNETSNMP_LIBS="-lnetsnmp"
 fi
+if test "x$with_libnetsnmpagent" = "xyes"
+then
+       BUILD_WITH_LIBNETSNMP_LIBS+=" -lnetsnmpagent"
+fi
 AC_SUBST(BUILD_WITH_LIBNETSNMP_CPPFLAGS)
 AC_SUBST(BUILD_WITH_LIBNETSNMP_LDFLAGS)
 AC_SUBST(BUILD_WITH_LIBNETSNMP_LIBS)
@@ -5341,6 +5356,11 @@ if test "x$with_libyajl" = "xyes"; then
     [with_libyajl="no (yajl/yajl_parse.h not found)"]
   )
 
+  AC_CHECK_HEADERS([yajl/yajl_tree.h],
+    [with_libyajl2="yes"],
+    [with_libyajl2="no (yajl/yajl_tree.h not found)"]
+  )
+
   AC_CHECK_HEADERS([yajl/yajl_version.h])
 
   CPPFLAGS="$SAVE_CPPFLAGS"
@@ -5355,6 +5375,11 @@ if test "x$with_libyajl" = "xyes"; then
     [with_libyajl="no (Symbol 'yajl_alloc' not found)"]
   )
 
+  AC_CHECK_LIB([yajl], [yajl_tree_parse],
+    [with_libyajl2="yes"],
+    [with_libyajl2="no (Symbol 'yajl_tree_parse' not found)"]
+  )
+
   LDFLAGS="$SAVE_LDFLAGS"
 fi
 
@@ -5882,12 +5907,14 @@ plugin_memory="no"
 plugin_multimeter="no"
 plugin_nfs="no"
 plugin_numa="no"
+plugin_ovs_events="no"
 plugin_perl="no"
 plugin_pinba="no"
 plugin_processes="no"
 plugin_protocols="no"
 plugin_python="no"
 plugin_serial="no"
+plugin_snmp_agent="no"
 plugin_smart="no"
 plugin_swap="no"
 plugin_tape="no"
@@ -6070,6 +6097,7 @@ if test "x$have_sysctl" = "xyes"; then
     plugin_swap="yes"
   fi
 fi
+
 if test "x$have_sysctlbyname" = "xyes"; then
   plugin_contextswitch="yes"
   plugin_cpu="yes"
@@ -6128,6 +6156,10 @@ if test "x$with_libyajl" = "xyes"; then
   plugin_log_logstash="yes"
 fi
 
+if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then
+  plugin_ovs_events="yes"
+fi
+
 if test "x$with_libperl" = "xyes" && test "x$c_cv_have_perl_ithreads" = "xyes"; then
   plugin_perl="yes"
 fi
@@ -6175,6 +6207,10 @@ if test "x$with_kvm_getswapinfo" = "xyes"; then
   plugin_swap="yes"
 fi
 
+if test "x$with_libnetsnmp" = "xyes" && test "x$with_libnetsnmpagent" = "xyes"; then
+  plugin_snmp_agent="yes"
+fi
+
 if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_two_args" = "xyes"; then
   plugin_swap="yes"
 fi
@@ -6253,7 +6289,7 @@ AC_PLUGIN([dbi],                 [$with_libdbi],            [General database st
 AC_PLUGIN([df],                  [$plugin_df],              [Filesystem usage statistics])
 AC_PLUGIN([disk],                [$plugin_disk],            [Disk usage statistics])
 AC_PLUGIN([dns],                 [$with_libpcap],           [DNS traffic analysis])
-AC_PLUGIN([dpdkstat],            [$plugin_dpdkstat],        [Stats & Status from DPDK])
+AC_PLUGIN([dpdkstat],            [$plugin_dpdkstat],        [Stats from DPDK])
 AC_PLUGIN([drbd],                [$plugin_drbd],            [DRBD statistics])
 AC_PLUGIN([email],               [yes],                     [EMail statistics])
 AC_PLUGIN([entropy],             [$plugin_entropy],         [Entropy statistics])
@@ -6314,6 +6350,7 @@ AC_PLUGIN([onewire],             [$with_libowcapi],         [OneWire sensor stat
 AC_PLUGIN([openldap],            [$with_libldap],           [OpenLDAP statistics])
 AC_PLUGIN([openvpn],             [yes],                     [OpenVPN client statistics])
 AC_PLUGIN([oracle],              [$with_oracle],            [Oracle plugin])
+AC_PLUGIN([ovs_events],          [$plugin_ovs_events],      [OVS events plugin])
 AC_PLUGIN([perl],                [$plugin_perl],            [Embed a Perl interpreter])
 AC_PLUGIN([pf],                  [$have_net_pfvar_h],       [BSD packet filter (PF) statistics])
 # FIXME: Check for libevent, too.
@@ -6333,6 +6370,7 @@ AC_PLUGIN([serial],              [$plugin_serial],          [serial port traffic
 AC_PLUGIN([sigrok],              [$with_libsigrok],         [sigrok acquisition sources])
 AC_PLUGIN([smart],               [$plugin_smart],           [SMART statistics])
 AC_PLUGIN([snmp],                [$with_libnetsnmp],        [SNMP querying plugin])
+AC_PLUGIN([snmp_agent],          [$plugin_snmp_agent],      [SNMP agent plugin])
 AC_PLUGIN([statsd],              [yes],                     [StatsD plugin])
 AC_PLUGIN([swap],                [$plugin_swap],            [Swap usage statistics])
 AC_PLUGIN([syslog],              [$have_syslog],            [Syslog logging plugin])
@@ -6738,6 +6776,7 @@ AC_MSG_RESULT([    onewire . . . . . . . $enable_onewire])
 AC_MSG_RESULT([    openldap  . . . . . . $enable_openldap])
 AC_MSG_RESULT([    openvpn . . . . . . . $enable_openvpn])
 AC_MSG_RESULT([    oracle  . . . . . . . $enable_oracle])
+AC_MSG_RESULT([    ovs_events  . . . . . $enable_ovs_events])
 AC_MSG_RESULT([    perl  . . . . . . . . $enable_perl])
 AC_MSG_RESULT([    pf  . . . . . . . . . $enable_pf])
 AC_MSG_RESULT([    pinba . . . . . . . . $enable_pinba])
@@ -6756,6 +6795,7 @@ AC_MSG_RESULT([    serial  . . . . . . . $enable_serial])
 AC_MSG_RESULT([    sigrok  . . . . . . . $enable_sigrok])
 AC_MSG_RESULT([    smart . . . . . . . . $enable_smart])
 AC_MSG_RESULT([    snmp  . . . . . . . . $enable_snmp])
+AC_MSG_RESULT([    snmp_agent  . . . . . $enable_snmp_agent])
 AC_MSG_RESULT([    statsd  . . . . . . . $enable_statsd])
 AC_MSG_RESULT([    swap  . . . . . . . . $enable_swap])
 AC_MSG_RESULT([    syslog  . . . . . . . $enable_syslog])