blob: 812be9cfbe3463d51809e7d2bb15d1936eb59380 (
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
34
35
|
<?php
# Collectd filecount plugin
require_once 'conf/common.inc.php';
require_once 'type/GenericStacked.class.php';
require_once 'inc/collectd.inc.php';
## LAYOUT
# filecount-X/
# filecount-X/bytes.rrd
# filecount-X/files.rrd
$obj = new Type_GenericStacked($CONFIG, $_GET);
$obj->rrd_format = '%5.1lf%s';
$obj->data_sources = array('value');
switch($obj->args['type']) {
case 'bytes':
$obj->ds_names = array('value' => 'Size');
$obj->colors = array('value' => '0000ff');
$obj->rrd_title = sprintf('Filecount: size (%s)', $obj->args['pinstance']);
$obj->rrd_vertical = 'Bytes';
break;
case 'files':
$obj->ds_names = array('value' => 'Files');
$obj->colors = array('value' => 'f0a000');
$obj->rrd_title = sprintf('Filecount: number of files (%s)', $obj->args['pinstance']);
$obj->rrd_vertical = 'Files';
break;
}
collectd_flush($obj->identifiers);
$obj->rrd_graph();
|