diff options
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(); | ||
