From 0b1741c59352a1842f9f81e31b8a8dc5b94323b7 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Mon, 1 Mar 2010 20:28:17 +0100 Subject: utf8 filename support for all types Types GenenericIO and GenericStacked were not included in commit: 596dd7d414 [make rrdfiles using utf8 and spaces work] --- type/GenericIO.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'type/GenericIO.class.php') diff --git a/type/GenericIO.class.php b/type/GenericIO.class.php index ee04316..944c82e 100644 --- a/type/GenericIO.class.php +++ b/type/GenericIO.class.php @@ -14,9 +14,9 @@ class Type_GenericIO extends Type_Default { $i=0; foreach ($this->tinstances as $tinstance) { foreach ($this->data_sources as $ds) { - $rrdgraph[] = sprintf('DEF:min_%s%s=%s:%s:MIN', $sources[$i], $raw, $this->files[$tinstance], $ds); - $rrdgraph[] = sprintf('DEF:avg_%s%s=%s:%s:AVERAGE', $sources[$i], $raw, $this->files[$tinstance], $ds); - $rrdgraph[] = sprintf('DEF:max_%s%s=%s:%s:MAX', $sources[$i], $raw, $this->files[$tinstance], $ds); + $rrdgraph[] = sprintf('DEF:min_%s%s=%s:%s:MIN', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds); + $rrdgraph[] = sprintf('DEF:avg_%s%s=%s:%s:AVERAGE', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds); + $rrdgraph[] = sprintf('DEF:max_%s%s=%s:%s:MAX', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds); $i++; } } @@ -24,19 +24,19 @@ class Type_GenericIO extends Type_Default { $i=0; foreach ($this->tinstances as $tinstance) { foreach ($this->data_sources as $ds) { - $rrdgraph[] = sprintf('CDEF:min_%s=min_%1$s_raw,%s,*', $sources[$i], $this->scale); - $rrdgraph[] = sprintf('CDEF:avg_%s=avg_%1$s_raw,%s,*', $sources[$i], $this->scale); - $rrdgraph[] = sprintf('CDEF:max_%s=max_%1$s_raw,%s,*', $sources[$i], $this->scale); + $rrdgraph[] = sprintf('CDEF:min_%s=min_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale); + $rrdgraph[] = sprintf('CDEF:avg_%s=avg_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale); + $rrdgraph[] = sprintf('CDEF:max_%s=max_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale); $i++; } } } $rrdgraph[] = sprintf('CDEF:overlap=avg_%s,avg_%s,LT,avg_%1$s,avg_%2$s,IF', - $sources[0], $sources[1]); + crc32hex($sources[0]), crc32hex($sources[1])); foreach($sources as $source) { - $rrdgraph[] = sprintf('AREA:avg_%s#%s', $source, $this->get_faded_color($this->colors[$source])); + $rrdgraph[] = sprintf('AREA:avg_%s#%s', crc32hex($source), $this->get_faded_color($this->colors[$source])); } $rrdgraph[] = sprintf('AREA:overlap#%s', @@ -48,11 +48,11 @@ class Type_GenericIO extends Type_Default { foreach($sources as $source) { $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source; - $rrdgraph[] = sprintf('LINE1:avg_%s#%s:\'%s\'', $source, $this->colors[$source], $dsname); - $rrdgraph[] = sprintf('GPRINT:min_%s:MIN:\'%s Min,\'', $source, $this->rrd_format); - $rrdgraph[] = sprintf('GPRINT:avg_%s:AVERAGE:\'%s Avg,\'', $source, $this->rrd_format); - $rrdgraph[] = sprintf('GPRINT:max_%s:MAX:\'%s Max,\'', $source, $this->rrd_format); - $rrdgraph[] = sprintf('GPRINT:avg_%s:LAST:\'%s Last\l\'', $source, $this->rrd_format); + $rrdgraph[] = sprintf('LINE1:avg_%s#%s:\'%s\'', crc32hex($source), $this->colors[$source], $dsname); + $rrdgraph[] = sprintf('GPRINT:min_%s:MIN:\'%s Min,\'', crc32hex($source), $this->rrd_format); + $rrdgraph[] = sprintf('GPRINT:avg_%s:AVERAGE:\'%s Avg,\'', crc32hex($source), $this->rrd_format); + $rrdgraph[] = sprintf('GPRINT:max_%s:MAX:\'%s Max,\'', crc32hex($source), $this->rrd_format); + $rrdgraph[] = sprintf('GPRINT:avg_%s:LAST:\'%s Last\l\'', crc32hex($source), $this->rrd_format); } return $rrdgraph; -- cgit v1.1