aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin
diff options
context:
space:
mode:
authorPim van den Berg2012-09-07 13:48:21 +0200
committerPim van den Berg2012-09-07 14:09:34 +0200
commite3f1cc22b6f392ba808034ef58e3b7946e3f0ba8 (patch)
treedd7c34e42c0a25b0e2ca47c55a3e3cf9c58875b3 /plugin
parentplugin/snmp: add support for if_octets (diff)
downloadapt-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 '')
-rw-r--r--plugin/varnish.php17
1 files changed, 3 insertions, 14 deletions
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);
26$obj->width = $width; 26$obj->width = $width;
27$obj->heigth = $heigth; 27$obj->heigth = $heigth;
28$obj->rrd_format = '%5.1lf%s'; 28$obj->rrd_format = '%5.1lf%s';
29switch($obj->args['pinstance']) { 29$obj->rrd_title = sprintf('%s (%s)', ucfirst($obj->args['pinstance']), $obj->args['category']);
30 case 'default-backend': 30$obj->rrd_vertical = 'hits';
31 $obj->rrd_title = 'backend'; 31
32 $obj->rrd_vertical = 'hits';
33 break;
34 case 'default-cache':
35 $obj->rrd_title = 'cache';
36 $obj->rrd_vertical = 'hits';
37 break;
38 case 'default-connections':
39 $obj->rrd_title = 'connections';
40 $obj->rrd_vertical = 'hits';
41 break;
42}
43collectd_flush($obj->identifiers); 32collectd_flush($obj->identifiers);
44$obj->rrd_graph(); 33$obj->rrd_graph();