diff options
author | Pim van den Berg | 2011-08-27 18:22:24 +0200 |
---|---|---|
committer | Pim van den Berg | 2011-08-27 18:32:38 +0200 |
commit | 330c94f4f3437036a50a57f1b3f5ca7e991c2230 (patch) | |
tree | 29b916a3aa69f38adcd6ff96bbd4fa12c97e9258 /type/GenericIO.class.php | |
parent | plugin/apcups: collectd 5 compatibility (diff) | |
download | apt-panopticon_cgp-330c94f4f3437036a50a57f1b3f5ca7e991c2230.zip apt-panopticon_cgp-330c94f4f3437036a50a57f1b3f5ca7e991c2230.tar.gz apt-panopticon_cgp-330c94f4f3437036a50a57f1b3f5ca7e991c2230.tar.bz2 apt-panopticon_cgp-330c94f4f3437036a50a57f1b3f5ca7e991c2230.tar.xz |
type: escape colons in filenames used in rrd commandline
A colon ':' in a legend argument will mark the end of the legend:
http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html#INOTES_on_legend_arguments
Reported-by: Benjamin Dupuis <poil@quake.fr>
Diffstat (limited to 'type/GenericIO.class.php')
-rw-r--r-- | type/GenericIO.class.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/type/GenericIO.class.php b/type/GenericIO.class.php index 18a27ea..bc0fdef 100644 --- a/type/GenericIO.class.php +++ b/type/GenericIO.class.php | |||
@@ -14,9 +14,9 @@ class Type_GenericIO extends Type_Default { | |||
14 | $i=0; | 14 | $i=0; |
15 | foreach ($this->tinstances as $tinstance) { | 15 | foreach ($this->tinstances as $tinstance) { |
16 | foreach ($this->data_sources as $ds) { | 16 | foreach ($this->data_sources as $ds) { |
17 | $rrdgraph[] = sprintf('DEF:min_%s%s=%s:%s:MIN', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds); | 17 | $rrdgraph[] = sprintf('DEF:min_%s%s="%s":%s:MIN', crc32hex($sources[$i]), $raw, $this->rrd_escape($this->files[$tinstance]), $ds); |
18 | $rrdgraph[] = sprintf('DEF:avg_%s%s=%s:%s:AVERAGE', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds); | 18 | $rrdgraph[] = sprintf('DEF:avg_%s%s="%s":%s:AVERAGE', crc32hex($sources[$i]), $raw, $this->rrd_escape($this->files[$tinstance]), $ds); |
19 | $rrdgraph[] = sprintf('DEF:max_%s%s=%s:%s:MAX', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds); | 19 | $rrdgraph[] = sprintf('DEF:max_%s%s="%s":%s:MAX', crc32hex($sources[$i]), $raw, $this->rrd_escape($this->files[$tinstance]), $ds); |
20 | $rrdgraph[] = sprintf('VDEF:tot_%1$s=avg_%1$s%2$s,TOTAL', crc32hex($sources[$i]), $raw); | 20 | $rrdgraph[] = sprintf('VDEF:tot_%1$s=avg_%1$s%2$s,TOTAL', crc32hex($sources[$i]), $raw); |
21 | $i++; | 21 | $i++; |
22 | } | 22 | } |