aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/wireless.php
blob: 70598b5a115ed6818150cd610d7ffbce705e4d50 (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
<?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, $_GET);
$obj->data_sources = array('value');
$obj->ds_names = array('value' => 'Value');
$obj->colors = array('value' => '0000f0');
$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();