diff options
author | Pim van den Berg | 2010-07-19 22:45:20 +0200 |
---|---|---|
committer | Pim van den Berg | 2010-07-19 22:51:30 +0200 |
commit | d62033252236ebcb598576e9c1e32c66ca883c85 (patch) | |
tree | c1e6b863d2cbacbb5acb3ac11b989270253acec5 /plugin | |
parent | plugin: add wireless plugin (diff) | |
download | apt-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 '')
-rw-r--r-- | plugin/wireless.php | 29 |
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'; | |||
7 | require_once 'inc/collectd.inc.php'; | 7 | require_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 | ||
13 | switch($obj->args['type']) { | 17 | switch($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 | |||
39 | collectd_flush($obj->identifiers); | 32 | collectd_flush($obj->identifiers); |
40 | $obj->rrd_graph(); | 33 | $obj->rrd_graph(); |
41 | 34 | ||