From 117b67542656ceda6570050d04c83de48ed7bf8a Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 30 Apr 2008 19:43:32 +0200 Subject: [PATCH] powerdns plugin: Completed the list of values for the authorative server. Also added a TODO comment that should be resolved before releasing 4.4. --- TODO | 3 ++ src/powerdns.c | 77 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/TODO b/TODO index 2a5b7ca4..08fcec1e 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ +For version 4.4: +* PowerDNS plugin + For version 4.3: * unixsock plugin: Remove the custom cache if possible. diff --git a/src/powerdns.c b/src/powerdns.c index 9caa7708..5a4ccf8a 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -121,44 +121,45 @@ user-msec number of CPU milliseconds spent in 'user' mode statname_lookup_t lookup_table[] = /* {{{ */ { - /* - * Recursor statistics - */ - /* - * corrupt-packets - * deferred-cache-inserts - * deferred-cache-lookup - * qsize-q - * servfail-packets - * timedout-packets - * udp4-answers - * udp4-queries - * udp6-answers - * udp6-queries - */ + /********************* + * Server statistics * + *********************/ /* Questions */ - {"recursing-questions", "dns_question", "recurse"}, - {"tcp-queries", "dns_question", "tcp"}, - {"udp-queries", "dns_question", "udp"}, + {"recursing-questions", "dns_question", "recurse"}, + {"tcp-queries", "dns_question", "tcp"}, + {"udp-queries", "dns_question", "udp"}, /* Answers */ - {"recursing-answers", "dns_answer", "recurse"}, - {"tcp-answers", "dns_answer", "tcp"}, - {"udp-answers", "dns_answer", "udp"}, + {"recursing-answers", "dns_answer", "recurse"}, + {"tcp-answers", "dns_answer", "tcp"}, + {"udp-answers", "dns_answer", "udp"}, /* Cache stuff */ - {"packetcache-hit", "cache_result", "packet-hit"}, - {"packetcache-miss", "cache_result", "packet-miss"}, - {"packetcache-size", "cache_size", "packet"}, - {"query-cache-hit", "cache_result", "query-hit"}, - {"query-cache-miss", "cache_result", "query-miss"}, + {"packetcache-hit", "cache_result", "packet-hit"}, + {"packetcache-miss", "cache_result", "packet-miss"}, + {"packetcache-size", "cache_size", "packet"}, + {"query-cache-hit", "cache_result", "query-hit"}, + {"query-cache-miss", "cache_result", "query-miss"}, /* Latency */ - {"latency", "latency", NULL}, - - /* - * Recursor statistics - */ + {"latency", "latency", NULL}, + + /* Other stuff.. */ + {"corrupt-packets", "io_packets", "corrupt"}, + {"deferred-cache-inserts", "counter", "cache-deferred_insert"}, + {"deferred-cache-lookup", "counter", "cache-deferred_lookup"}, + {"qsize-a", "cache_size", "answers"}, + {"qsize-q", "cache_size", "questions"}, + {"servfail-packets", "io_packets", "servfail"}, + {"timedout-packets", "io_packets", "timeout"}, + {"udp4-answers", "dns_answer", "udp4"}, + {"udp4-queries", "dns_question", "queries-udp4"}, + {"udp6-answers", "dns_answer", "udp6"}, + {"udp6-queries", "dns_question", "queries-udp6"}, + + /*********************** + * Recursor statistics * + ***********************/ /* Answers by return code */ {"noerror-answers", "dns_rcode", "NOERROR"}, {"nxdomain-answers", "dns_rcode", "NXDOMAIN"}, @@ -178,6 +179,8 @@ statname_lookup_t lookup_table[] = /* {{{ */ /* Total number of questions.. */ {"questions", "dns_qtype", "total"} + + /* TODO: Add all recursor metrics here */ }; /* }}} */ int lookup_table_length = STATIC_ARRAY_SIZE (lookup_table); @@ -186,6 +189,18 @@ static llist_t *list = NULL; #define PDNS_LOCAL_SOCKPATH LOCALSTATEDIR"/run/"PACKAGE_NAME"-powerdns" static char *local_sockpath = NULL; +/* TODO: Do this before 4.4: + * - Make list of ``interesting values'' configurable + * - Authorative server: + * - Store each element in a list or an array + * - Check values returned by `SHOW *' against that list. + * - Recursor: + * - Use the list to build a command to request the given values + * - Complete list of known pdns -> collectd mappings. + * + * -octo + */ + /* */ static void submit (const char *plugin_instance, /* {{{ */ const char *pdns_type, const char *value) -- 2.30.2