From 42f95b39f4ec31b42f8e7e293c83d69938d84e7a Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 29 Jan 2011 19:16:39 +0100 Subject: plugin: add dns plugin --- plugin/dns.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 plugin/dns.php (limited to 'plugin') diff --git a/plugin/dns.php b/plugin/dns.php new file mode 100644 index 0000000..f0c1b85 --- /dev/null +++ b/plugin/dns.php @@ -0,0 +1,58 @@ +width = $width; +$obj->heigth = $heigth; +switch($obj->args['type']) { + case 'dns_octets': + $obj->data_sources = array( + 'queries', + 'responses', + ); + $obj->ds_names = array( + 'queries' => 'Queries', + 'responses' => 'Responses', + ); + $obj->colors = array( + 'queries' => '0000ff', + 'responses' => '00ff00', + ); + $obj->rrd_title = 'DNS traffic'; + $obj->rrd_vertical = 'Bit/s'; + $obj->rrd_format = '%5.1lf%s'; + break; + case 'dns_opcode': + $obj->data_sources = array('value'); + $obj->ds_names = array( + 'value' => 'Queries/s', + ); + $obj->colors = array( + 'value' => '0000ff', + ); + $obj->rrd_title = 'DNS Opcode Query'; + $obj->rrd_vertical = 'Queries/s'; + $obj->rrd_format = '%5.1lf%s'; + break; + case 'dns_qtype': + $obj->data_sources = array('value'); + $obj->generate_colors(); + $obj->rrd_title = 'DNS QType'; + $obj->rrd_vertical = 'Queries/s'; + $obj->rrd_format = '%5.1lf%s'; + break; +} + +collectd_flush($obj->identifiers); +$obj->rrd_graph(); -- cgit v1.1