aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/dns.php
diff options
context:
space:
mode:
authorPim van den Berg2011-04-10 19:56:08 +0200
committerPim van den Berg2011-04-10 19:56:08 +0200
commit6bc103c0c6880673f207c87466f4fcac2645bd8c (patch)
tree829fa608416de0dea83b3c9c1689cb7077dfa943 /plugin/dns.php
parentplugin: add tail plugin (diff)
downloadapt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.zip
apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.gz
apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.bz2
apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.xz
plugin: deduplicate rrd_format code
Diffstat (limited to 'plugin/dns.php')
-rw-r--r--plugin/dns.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/dns.php b/plugin/dns.php
index 15143b5..d0784df 100644
--- a/plugin/dns.php
+++ b/plugin/dns.php
@@ -15,6 +15,8 @@ require_once 'inc/collectd.inc.php';
15$obj = new Type_GenericStacked($CONFIG); 15$obj = new Type_GenericStacked($CONFIG);
16$obj->width = $width; 16$obj->width = $width;
17$obj->heigth = $heigth; 17$obj->heigth = $heigth;
18$obj->rrd_format = '%5.1lf%s';
19
18switch($obj->args['type']) { 20switch($obj->args['type']) {
19 case 'dns_octets': 21 case 'dns_octets':
20 $obj->data_sources = array( 22 $obj->data_sources = array(
@@ -31,19 +33,16 @@ switch($obj->args['type']) {
31 ); 33 );
32 $obj->rrd_title = 'DNS traffic'; 34 $obj->rrd_title = 'DNS traffic';
33 $obj->rrd_vertical = 'Bit/s'; 35 $obj->rrd_vertical = 'Bit/s';
34 $obj->rrd_format = '%5.1lf%s';
35 break; 36 break;
36 case 'dns_opcode': 37 case 'dns_opcode':
37 $obj->data_sources = array('value'); 38 $obj->data_sources = array('value');
38 $obj->rrd_title = 'DNS Opcode Query'; 39 $obj->rrd_title = 'DNS Opcode Query';
39 $obj->rrd_vertical = 'Queries/s'; 40 $obj->rrd_vertical = 'Queries/s';
40 $obj->rrd_format = '%5.1lf%s';
41 break; 41 break;
42 case 'dns_qtype': 42 case 'dns_qtype':
43 $obj->data_sources = array('value'); 43 $obj->data_sources = array('value');
44 $obj->rrd_title = 'DNS QType'; 44 $obj->rrd_title = 'DNS QType';
45 $obj->rrd_vertical = 'Queries/s'; 45 $obj->rrd_vertical = 'Queries/s';
46 $obj->rrd_format = '%5.1lf%s';
47 break; 46 break;
48} 47}
49 48