From: Florian Forster Date: Fri, 18 May 2007 15:10:35 +0000 (+0200) Subject: dns plugin: Only submit dns-traffic if either counter is non-zero. X-Git-Tag: collectd-4.0.0~34 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4256c346a988d202b31442f6837d2672af80798b;p=collectd.git dns plugin: Only submit dns-traffic if either counter is non-zero. --- diff --git a/src/dns.c b/src/dns.c index 5af9c20c..7ce7aad9 100644 --- a/src/dns.c +++ b/src/dns.c @@ -348,7 +348,9 @@ static int dns_read (void) values[0] = tr_queries; values[1] = tr_responses; pthread_mutex_unlock (&traffic_mutex); - submit_octets (values[0], values[1]); + + if ((values[0] != 0) || (values[1] != 0)) + submit_octets (values[0], values[1]); pthread_mutex_lock (&qtype_mutex); for (ptr = qtype_list, len = 0;