diff options
author | Pim van den Berg | 2011-03-08 21:40:19 +0100 |
---|---|---|
committer | Pim van den Berg | 2011-03-08 21:40:38 +0100 |
commit | dac646f6c4b3053b15ae3d748fb1f95746476aaf (patch) | |
tree | cc2ad89edf26e60b0eed68bb35b63736ff71bcf8 /plugin | |
parent | plugin/cpufreq: Y-axis is in hertz (diff) | |
download | apt-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 '')
-rw-r--r-- | plugin/filecount.php | 37 |
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 | |||
5 | require_once 'conf/common.inc.php'; | ||
6 | require_once 'type/GenericStacked.class.php'; | ||
7 | require_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 | |||
21 | switch($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 | |||
36 | collectd_flush($obj->identifiers); | ||
37 | $obj->rrd_graph(); | ||