aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/tail.php
blob: 91400c7b84fc1f4a963add8f0f7d93a93948a17c (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
<?php

# Collectd tail plugin

require_once 'conf/common.inc.php';
require_once 'type/Default.class.php';


$obj = new Type_Default($CONFIG, $_GET);

$obj->rrd_title = sprintf('tail: %s (%s)', $obj->args['pinstance'], $obj->args['type']);
$obj->rrd_format = '%5.1lf%s';

# backwards compatibility
if ($CONFIG['version'] < 5) {
	if (strcmp($obj->args['type'], 'gauge') != 0) {
		$obj->data_sources = array('count');
		if (count($obj->ds_names) == 1) {
			$obj->ds_names['count'] = $obj->ds_names['value'];
			unset($obj->ds_names['value']);
		}
		if (count($obj->colors) == 1) {
			$obj->colors['count'] = $obj->colors['value'];
			unset($obj->colors['value']);
		}
	}
}

$obj->rrd_graph();