From dac646f6c4b3053b15ae3d748fb1f95746476aaf Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Tue, 8 Mar 2011 21:40:19 +0100 Subject: plugin: add filecount plugin --- plugin/filecount.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugin/filecount.php (limited to 'plugin') 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 @@ +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(); -- cgit v1.1