diff options
author | Pim van den Berg | 2012-09-07 13:48:21 +0200 |
---|---|---|
committer | Pim van den Berg | 2012-09-07 14:09:34 +0200 |
commit | e3f1cc22b6f392ba808034ef58e3b7946e3f0ba8 (patch) | |
tree | dd7c34e42c0a25b0e2ca47c55a3e3cf9c58875b3 /type/Default.class.php | |
parent | plugin/snmp: add support for if_octets (diff) | |
download | apt-panopticon_cgp-e3f1cc22b6f392ba808034ef58e3b7946e3f0ba8.zip apt-panopticon_cgp-e3f1cc22b6f392ba808034ef58e3b7946e3f0ba8.tar.gz apt-panopticon_cgp-e3f1cc22b6f392ba808034ef58e3b7946e3f0ba8.tar.bz2 apt-panopticon_cgp-e3f1cc22b6f392ba808034ef58e3b7946e3f0ba8.tar.xz |
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:
<plugin>-<category>-<plugin_instance>/<type>-<type_instance>
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 <jonathan.huot@gmail.com>
Diffstat (limited to 'type/Default.class.php')
-rw-r--r-- | type/Default.class.php | 12 |
1 files changed, 9 insertions, 3 deletions
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 { | |||
62 | 'host' => GET('h'), | 62 | 'host' => GET('h'), |
63 | 'plugin' => GET('p'), | 63 | 'plugin' => GET('p'), |
64 | 'pinstance' => GET('pi'), | 64 | 'pinstance' => GET('pi'), |
65 | 'category' => GET('c'), | ||
65 | 'type' => GET('t'), | 66 | 'type' => GET('t'), |
66 | 'tinstance' => GET('ti'), | 67 | 'tinstance' => GET('ti'), |
67 | ); | 68 | ); |
@@ -120,9 +121,14 @@ class Type_Default { | |||
120 | } | 121 | } |
121 | 122 | ||
122 | function get_filenames() { | 123 | function get_filenames() { |
123 | $identifier = sprintf('%s/%s%s%s/%s%s%s', $this->args['host'], | 124 | $identifier = sprintf('%s/%s%s%s%s%s/%s%s%s', |
124 | $this->args['plugin'], strlen($this->args['pinstance']) ? '-' : '', $this->args['pinstance'], | 125 | $this->args['host'], |
125 | $this->args['type'], strlen($this->args['tinstance']) ? '-' : '', $this->args['tinstance']); | 126 | $this->args['plugin'], |
127 | strlen($this->args['category']) ? '-' : '', $this->args['category'], | ||
128 | strlen($this->args['pinstance']) ? '-' : '', $this->args['pinstance'], | ||
129 | $this->args['type'], | ||
130 | strlen($this->args['tinstance']) ? '-' : '', $this->args['tinstance'] | ||
131 | ); | ||
126 | 132 | ||
127 | $wildcard = strlen($this->args['tinstance']) ? '.' : '[-.]*'; | 133 | $wildcard = strlen($this->args['tinstance']) ? '.' : '[-.]*'; |
128 | 134 | ||