aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/filecount.php
blob: daa9fd95f7aa52f83018965a4a16c90c0a9a4a0d (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);

$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();