aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/filecount.php
blob: fa11a91c689c9ef8a4959490850908cbcd88f10d (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
36
37
<?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->width = $width;
$obj->heigth = $heigth;
$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' => '0000ff');
		$obj->rrd_title = sprintf('Filecount: number of files (%s)', $obj->args['pinstance']);
		$obj->rrd_vertical = 'Files';
		break;
}

collectd_flush($obj->identifiers);
$obj->rrd_graph();