aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin
diff options
context:
space:
mode:
authorPim van den Berg2010-07-19 22:45:20 +0200
committerPim van den Berg2010-07-19 22:51:30 +0200
commitd62033252236ebcb598576e9c1e32c66ca883c85 (patch)
treec1e6b863d2cbacbb5acb3ac11b989270253acec5 /plugin
parentplugin: add wireless plugin (diff)
downloadapt-panopticon_cgp-d62033252236ebcb598576e9c1e32c66ca883c85.zip
apt-panopticon_cgp-d62033252236ebcb598576e9c1e32c66ca883c85.tar.gz
apt-panopticon_cgp-d62033252236ebcb598576e9c1e32c66ca883c85.tar.bz2
apt-panopticon_cgp-d62033252236ebcb598576e9c1e32c66ca883c85.tar.xz
plugin/wireless: better labels and deduplicate code
Wireless tools for Linux uses these labels: - signal_noice: Noice level - signal_power: Signal level - signal_quality: Link quality
Diffstat (limited to 'plugin')
-rw-r--r--plugin/wireless.php29
1 files changed, 11 insertions, 18 deletions
diff --git a/plugin/wireless.php b/plugin/wireless.php
index 6f3af36..bbb9f4a 100644
--- a/plugin/wireless.php
+++ b/plugin/wireless.php
@@ -7,35 +7,28 @@ require_once 'type/GenericStacked.class.php';
7require_once 'inc/collectd.inc.php'; 7require_once 'inc/collectd.inc.php';
8 8
9$obj = new Type_GenericStacked($CONFIG); 9$obj = new Type_GenericStacked($CONFIG);
10$obj->data_sources = array('value');
11$obj->ds_names = array('value' => 'Value');
12$obj->colors = array('value' => '0000f0');
10$obj->width = $width; 13$obj->width = $width;
11$obj->heigth = $heigth; 14$obj->heigth = $heigth;
15$obj->rrd_format = '%6.1lf';
12 16
13switch($obj->args['type']) { 17switch($obj->args['type']) {
14 case 'signal_noise': 18 case 'signal_noise':
15 $obj->data_sources = array('value'); 19 $obj->rrd_title = sprintf('Noise level (%s)', $obj->args['pinstance']);
16 $obj->colors = array('value' => '0000f0'); 20 $obj->rrd_vertical = 'dBm';
17 $obj->ds_names = array('value' => 'Value');
18 $obj->rrd_title = 'Signal Noise';
19 $obj->rrd_vertical = '';
20 $obj->rrd_format = '%6.1lf';
21 break; 21 break;
22 case 'signal_power': 22 case 'signal_power':
23 $obj->data_sources = array('value'); 23 $obj->rrd_title = sprintf('Signal level (%s)', $obj->args['pinstance']);
24 $obj->colors = array('value' => '0000f0'); 24 $obj->rrd_vertical = 'dBm';
25 $obj->ds_names = array('value' => 'Value');
26 $obj->rrd_title = 'Signal Power';
27 $obj->rrd_vertical = '';
28 $obj->rrd_format = '%6.1lf';
29 break; 25 break;
30 case 'signal_quality': 26 case 'signal_quality':
31 $obj->data_sources = array('value'); 27 $obj->rrd_title = sprintf('Link Quality (%s)', $obj->args['pinstance']);
32 $obj->colors = array('value' => '0000f0'); 28 $obj->rrd_vertical = 'quality';
33 $obj->ds_names = array('value' => 'Value');
34 $obj->rrd_title = 'Signal Quality';
35 $obj->rrd_vertical = '';
36 $obj->rrd_format = '%6.1lf';
37 break; 29 break;
38} 30}
31
39collectd_flush($obj->identifiers); 32collectd_flush($obj->identifiers);
40$obj->rrd_graph(); 33$obj->rrd_graph();
41 34