From 67fde1b848831de9da2f7a77ab60887ba2b252db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bruno=20Pr=C3=A9mont?= Date: Thu, 19 Feb 2009 09:42:05 +0100 Subject: [PATCH] bind plugin: Fix various bugs. On Mon, 16 February 2009 Florian Forster wrote: > The new plugins are: > > * BIND: Name-server and zone statistics A few bugs are hidden there, attached is a patch that fixes most of those I've discovered untils now. - Url parameter never considered - missing type definition for dns_reject - MemoryStats is linked to the wrong variable (TODO: memory stats seem not to work, probably dispatch_counter() for gauge value ...) - SOAOutv6 should be translated to SOA-IPv6 instead of SOA-IPv4 in order to be saved correctly and not cause timestamp collisions Bruno --- src/bind.c | 15 ++++++++++++--- src/types.db | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/bind.c b/src/bind.c index 8e785d98..bb3496ca 100644 --- a/src/bind.c +++ b/src/bind.c @@ -178,7 +178,7 @@ static const translation_info_t zonestats_translation_table[] = /* {{{ */ { "NotifyRej", "dns_notify", "rejected" }, /* SOA/AXFS/IXFS requests */ { "SOAOutv4", "dns_opcode", "SOA-IPv4" }, - { "SOAOutv6", "dns_opcode", "SOA-IPv4" }, + { "SOAOutv6", "dns_opcode", "SOA-IPv6" }, { "AXFRReqv4", "dns_opcode", "AXFR-IPv4" }, { "AXFRReqv6", "dns_opcode", "AXFR-IPv6" }, { "IXFRReqv4", "dns_opcode", "IXFR-IPv4" }, @@ -1315,7 +1315,16 @@ static int bind_config (oconfig_item_t *ci) /* {{{ */ { oconfig_item_t *child = ci->children + i; - if (strcasecmp ("OpCodes", child->key) == 0) + if (strcasecmp ("Url", child->key) == 0) { + if ((child->values_num != 1) || (child->values[0].type != OCONFIG_TYPE_STRING)) + { + WARNING ("bind plugin: The `Url' option needs " + "exactly one string argument."); + return (-1); + } + + url = strdup (child->values[0].value.string); + } else if (strcasecmp ("OpCodes", child->key) == 0) bind_config_set_bool ("OpCodes", &global_opcodes, child); else if (strcasecmp ("QTypes", child->key) == 0) bind_config_set_bool ("QTypes", &global_qtypes, child); @@ -1326,7 +1335,7 @@ static int bind_config (oconfig_item_t *ci) /* {{{ */ else if (strcasecmp ("ResolverStats", child->key) == 0) bind_config_set_bool ("ResolverStats", &global_resolver_stats, child); else if (strcasecmp ("MemoryStats", child->key) == 0) - bind_config_set_bool ("MemoryStats", &global_resolver_stats, child); + bind_config_set_bool ("MemoryStats", &global_memory_stats, child); else if (strcasecmp ("View", child->key) == 0) bind_config_add_view (child); else diff --git a/src/types.db b/src/types.db index 6d015323..82b5b4f3 100644 --- a/src/types.db +++ b/src/types.db @@ -33,6 +33,7 @@ dns_notify value:COUNTER:0:65535 dns_transfer value:COUNTER:0:65535 dns_query value:COUNTER:0:65535 dns_response value:COUNTER:0:65535 +dns_reject value:COUNTER:0:65535 email_check value:GAUGE:0:U email_count value:GAUGE:0:U email_size value:GAUGE:0:U -- 2.11.0