libcollectdclient: Propagate errors when signing / encrypting network packets.
[collectd.git] / src / powerdns.c
index a1b2355..ec337bf 100644 (file)
@@ -18,7 +18,7 @@
  *
  * Author:
  *   Luke Heberling <lukeh at c-ware.com>
- *   Florian Forster <octo at verplant.org>
+ *   Florian Forster <octo at collectd.org>
  *
  * DESCRIPTION
  *   Queries a PowerDNS control socket for statistics
@@ -84,10 +84,10 @@ typedef struct statname_lookup_s statname_lookup_t;
 
 /* Description of statistics returned by the recursor: {{{
 all-outqueries      counts the number of outgoing UDP queries since starting
-answers0-1          counts the number of queries answered within 1 milisecond
+answers0-1          counts the number of queries answered within 1 millisecond
 answers100-1000     counts the number of queries answered within 1 second
-answers10-100       counts the number of queries answered within 100 miliseconds
-answers1-10         counts the number of queries answered within 10 miliseconds
+answers10-100       counts the number of queries answered within 100 milliseconds
+answers1-10         counts the number of queries answered within 10 milliseconds
 answers-slow        counts the number of queries answered after 1 second
 cache-entries       shows the number of entries in the cache
 cache-hits          counts the number of cache hits since starting
@@ -147,22 +147,34 @@ statname_lookup_t lookup_table[] = /* {{{ */
   {"recursing-questions",    "dns_question", "recurse"},
   {"tcp-queries",            "dns_question", "tcp"},
   {"udp-queries",            "dns_question", "udp"},
+  {"rd-queries",             "dns_question", "rd"},
 
   /* Answers */
   {"recursing-answers",      "dns_answer",   "recurse"},
   {"tcp-answers",            "dns_answer",   "tcp"},
   {"udp-answers",            "dns_answer",   "udp"},
+  {"recursion-unanswered",   "dns_answer",   "recursion-unanswered"},
+  {"udp-answers-bytes",      "total_bytes",  "udp-answers-bytes"},
 
   /* Cache stuff */
   {"packetcache-hit",        "cache_result", "packet-hit"},
   {"packetcache-miss",       "cache_result", "packet-miss"},
   {"packetcache-size",       "cache_size",   "packet"},
+  {"key-cache-size",         "cache_size",   "key"},
+  {"meta-cache-size",        "cache_size",   "meta"},
+  {"signature-cache-size",   "cache_size",   "signature"},
   {"query-cache-hit",        "cache_result", "query-hit"},
   {"query-cache-miss",       "cache_result", "query-miss"},
 
   /* Latency */
   {"latency",                "latency",      NULL},
 
+  /* DNS updates */
+  {"dnsupdate-answers",      "dns_answer",   "dnsupdate-answer"},
+  {"dnsupdate-changes",      "dns_question", "dnsupdate-changes"},
+  {"dnsupdate-queries",      "dns_question", "dnsupdate-queries"},
+  {"dnsupdate-refused",      "dns_answer",   "dnsupdate-refused"},
+
   /* Other stuff.. */
   {"corrupt-packets",        "ipt_packets",  "corrupt"},
   {"deferred-cache-inserts", "counter",      "cache-deferred_insert"},
@@ -175,6 +187,9 @@ statname_lookup_t lookup_table[] = /* {{{ */
   {"udp4-queries",           "dns_question", "queries-udp4"},
   {"udp6-answers",           "dns_answer",   "udp6"},
   {"udp6-queries",           "dns_question", "queries-udp6"},
+  {"security-status",        "dns_question", "security-status"},
+  {"udp-do-queries",         "dns_question", "udp-do_queries"},
+  {"signatures",             "counter",      "signatures"},
 
   /***********************
    * Recursor statistics *
@@ -224,8 +239,8 @@ statname_lookup_t lookup_table[] = /* {{{ */
   {"throttle-entries",    "gauge",        "entries-throttle"},
   {"unauthorized-tcp",    "counter",      "denied-unauthorized_tcp"},
   {"unauthorized-udp",    "counter",      "denied-unauthorized_udp"},
-  {"unexpected-packets",  "dns_answer",   "unexpected"}
-  /* {"uptime", "", ""} */
+  {"unexpected-packets",  "dns_answer",   "unexpected"},
+  {"uptime",              "uptime",       NULL}
 }; /* }}} */
 int lookup_table_length = STATIC_ARRAY_SIZE (lookup_table);
 
@@ -259,9 +274,6 @@ static void submit (const char *plugin_instance, /* {{{ */
     if (strcmp (lookup_table[i].name, pdns_type) == 0)
       break;
 
-  if (lookup_table[i].type == NULL)
-    return;
-
   if (i >= lookup_table_length)
   {
     INFO ("powerdns plugin: submit: Not found in lookup table: %s = %s;",
@@ -269,6 +281,9 @@ static void submit (const char *plugin_instance, /* {{{ */
     return;
   }
 
+  if (lookup_table[i].type == NULL)
+    return;
+
   type = lookup_table[i].type;
   type_instance = lookup_table[i].type_instance;
 
@@ -364,7 +379,7 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */
       break;
     }
 
-    cdt_timeout = interval_g * 3 / 4;
+    cdt_timeout = plugin_get_interval () * 3 / 4;
     if (cdt_timeout < TIME_T_TO_CDTIME_T (2))
       cdt_timeout = TIME_T_TO_CDTIME_T (2);