});
g_lua.writeFunction("sendCustomTrap", [](const std::string& str) {
-#ifdef HAVE_NET_SNMP
if (g_snmpAgent && g_snmpTrapsEnabled) {
g_snmpAgent->sendCustomTrap(str);
}
-#endif /* HAVE_NET_SNMP */
});
g_lua.writeFunction("setServerPolicy", [](ServerPolicy policy) {
#include "dnsdist-snmp.hh"
#include "dolog.hh"
+bool g_snmpEnabled{false};
+bool g_snmpTrapsEnabled{false};
+DNSDistSNMPAgent* g_snmpAgent{nullptr};
+
#ifdef HAVE_NET_SNMP
#define DNSDIST_OID 1, 3, 6, 1, 4, 1, 43315, 3
static std::unordered_map<oid, DNSDistStats::entry_t> s_statsMap;
-bool g_snmpEnabled{false};
-bool g_snmpTrapsEnabled{false};
-DNSDistSNMPAgent* g_snmpAgent{nullptr};
-
/* We are never called for a GETNEXT if it's registered as a
"instance", as it's "magically" handled for us. */
/* a instance handler also only hands us one request at a time, so