aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPim van den Berg2013-12-29 17:00:23 +0100
committerPim van den Berg2013-12-29 17:01:13 +0100
commit8a83bc09aac260c9b35f5ab68d6685fad44c3113 (patch)
tree1bd814ef61629ba0b8841bab1598f957f45fc617
parentgraph: add configurable limit to graph width/height (diff)
downloadapt-panopticon_cgp-8a83bc09aac260c9b35f5ab68d6685fad44c3113.zip
apt-panopticon_cgp-8a83bc09aac260c9b35f5ab68d6685fad44c3113.tar.gz
apt-panopticon_cgp-8a83bc09aac260c9b35f5ab68d6685fad44c3113.tar.bz2
apt-panopticon_cgp-8a83bc09aac260c9b35f5ab68d6685fad44c3113.tar.xz
plugin/tail: collectd < 5 backwards compatibility
Closes: https://github.com/pommi/CGP/issues/36
-rw-r--r--plugin/tail.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugin/tail.php b/plugin/tail.php
index 0d3ca46..3afcc2e 100644
--- a/plugin/tail.php
+++ b/plugin/tail.php
@@ -12,5 +12,20 @@ $obj = new Type_Default($CONFIG);
12$obj->rrd_title = sprintf('tail: %s (%s)', $obj->args['pinstance'], $obj->args['type']); 12$obj->rrd_title = sprintf('tail: %s (%s)', $obj->args['pinstance'], $obj->args['type']);
13$obj->rrd_format = '%5.1lf%s'; 13$obj->rrd_format = '%5.1lf%s';
14 14
15# backwards compatibility
16if ($CONFIG['version'] < 5) {
17 if (strcmp($obj->args['type'], 'gauge') != 0) {
18 $obj->data_sources = array('count');
19 if (count($obj->ds_names) == 1) {
20 $obj->ds_names['count'] = $obj->ds_names['value'];
21 unset($obj->ds_names['value']);
22 }
23 if (count($obj->colors) == 1) {
24 $obj->colors['count'] = $obj->colors['value'];
25 unset($obj->colors['value']);
26 }
27 }
28}
29
15collectd_flush($obj->identifiers); 30collectd_flush($obj->identifiers);
16$obj->rrd_graph(); 31$obj->rrd_graph();