blob: 413ee280dae4ed3d935ccc7d99207fb8aa22217f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
<?php
# Collectd Wireless Plugin
require_once 'conf/common.inc.php';
require_once 'type/GenericStacked.class.php';
require_once 'inc/collectd.inc.php';
$obj = new Type_GenericStacked($CONFIG);
$obj->data_sources = array('value');
$obj->ds_names = array('value' => 'Value');
$obj->colors = array('value' => '0000f0');
$obj->width = $width;
$obj->heigth = $heigth;
$obj->rrd_format = '%6.1lf';
switch($obj->args['type']) {
case 'signal_noise':
$obj->rrd_title = sprintf('Noise level (%s)', $obj->args['pinstance']);
$obj->rrd_vertical = 'dBm';
break;
case 'signal_power':
$obj->rrd_title = sprintf('Signal level (%s)', $obj->args['pinstance']);
$obj->rrd_vertical = 'dBm';
break;
case 'signal_quality':
$obj->rrd_title = sprintf('Link Quality (%s)', $obj->args['pinstance']);
$obj->rrd_vertical = 'quality';
break;
}
collectd_flush($obj->identifiers);
$obj->rrd_graph();
|