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 --- type/Default.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'type') diff --git a/type/Default.class.php b/type/Default.class.php index b8650dc..dec583b 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -62,6 +62,7 @@ class Type_Default { 'host' => GET('h'), 'plugin' => GET('p'), 'pinstance' => GET('pi'), + 'category' => GET('c'), 'type' => GET('t'), 'tinstance' => GET('ti'), ); @@ -120,9 +121,14 @@ class Type_Default { } function get_filenames() { - $identifier = sprintf('%s/%s%s%s/%s%s%s', $this->args['host'], - $this->args['plugin'], strlen($this->args['pinstance']) ? '-' : '', $this->args['pinstance'], - $this->args['type'], strlen($this->args['tinstance']) ? '-' : '', $this->args['tinstance']); + $identifier = sprintf('%s/%s%s%s%s%s/%s%s%s', + $this->args['host'], + $this->args['plugin'], + strlen($this->args['category']) ? '-' : '', $this->args['category'], + strlen($this->args['pinstance']) ? '-' : '', $this->args['pinstance'], + $this->args['type'], + strlen($this->args['tinstance']) ? '-' : '', $this->args['tinstance'] + ); $wildcard = strlen($this->args['tinstance']) ? '.' : '[-.]*'; -- cgit v1.1