aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/filecount.php
diff options
context:
space:
mode:
authorPim van den Berg2011-03-08 21:40:19 +0100
committerPim van den Berg2011-03-08 21:40:38 +0100
commitdac646f6c4b3053b15ae3d748fb1f95746476aaf (patch)
treecc2ad89edf26e60b0eed68bb35b63736ff71bcf8 /plugin/filecount.php
parentplugin/cpufreq: Y-axis is in hertz (diff)
downloadapt-panopticon_cgp-dac646f6c4b3053b15ae3d748fb1f95746476aaf.zip
apt-panopticon_cgp-dac646f6c4b3053b15ae3d748fb1f95746476aaf.tar.gz
apt-panopticon_cgp-dac646f6c4b3053b15ae3d748fb1f95746476aaf.tar.bz2
apt-panopticon_cgp-dac646f6c4b3053b15ae3d748fb1f95746476aaf.tar.xz
plugin: add filecount plugin
Diffstat (limited to 'plugin/filecount.php')
-rw-r--r--plugin/filecount.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugin/filecount.php b/plugin/filecount.php
new file mode 100644
index 0000000..fa11a91
--- /dev/null
+++ b/plugin/filecount.php
@@ -0,0 +1,37 @@
1<?php
2
3# Collectd filecount plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/GenericStacked.class.php';
7require_once 'inc/collectd.inc.php';
8
9## LAYOUT
10# filecount-X/
11# filecount-X/bytes.rrd
12# filecount-X/files.rrd
13
14$obj = new Type_GenericStacked($CONFIG);
15
16$obj->width = $width;
17$obj->heigth = $heigth;
18$obj->rrd_format = '%5.1lf%s';
19$obj->data_sources = array('value');
20
21switch($obj->args['type']) {
22 case 'bytes':
23 $obj->ds_names = array('value' => 'Size');
24 $obj->colors = array('value' => '0000ff');
25 $obj->rrd_title = sprintf('Filecount: size (%s)', $obj->args['pinstance']);
26 $obj->rrd_vertical = 'Bytes';
27 break;
28 case 'files':
29 $obj->ds_names = array('value' => 'Files');
30 $obj->colors = array('value' => '0000ff');
31 $obj->rrd_title = sprintf('Filecount: number of files (%s)', $obj->args['pinstance']);
32 $obj->rrd_vertical = 'Files';
33 break;
34}
35
36collectd_flush($obj->identifiers);
37$obj->rrd_graph();