From e3f1cc22b6f392ba808034ef58e3b7946e3f0ba8 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Fri, 7 Sep 2012 13:48:21 +0200 Subject: add support for varnish plugin categories Since commit collectd-4.10.0-88-g02e12db the varnish plugin groups collected values in categories. The collectd filestructure used for varnish is now: --/- Because this isn't distinguishable from a regular plugin like df, ... df-var-tmp/df_complex-free.rrd ("var" isn't the category here) ... the category is only set with the varnish plugin. Reported-by: Jonathan Huot --- plugin/varnish.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'plugin/varnish.php') diff --git a/plugin/varnish.php b/plugin/varnish.php index 4de4463..8099691 100644 --- a/plugin/varnish.php +++ b/plugin/varnish.php @@ -26,19 +26,8 @@ $obj = new Type_Default($CONFIG); $obj->width = $width; $obj->heigth = $heigth; $obj->rrd_format = '%5.1lf%s'; -switch($obj->args['pinstance']) { - case 'default-backend': - $obj->rrd_title = 'backend'; - $obj->rrd_vertical = 'hits'; - break; - case 'default-cache': - $obj->rrd_title = 'cache'; - $obj->rrd_vertical = 'hits'; - break; - case 'default-connections': - $obj->rrd_title = 'connections'; - $obj->rrd_vertical = 'hits'; - break; -} +$obj->rrd_title = sprintf('%s (%s)', ucfirst($obj->args['pinstance']), $obj->args['category']); +$obj->rrd_vertical = 'hits'; + collectd_flush($obj->identifiers); $obj->rrd_graph(); -- cgit v1.1