aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type/Default.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'type/Default.class.php')
-rw-r--r--type/Default.class.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/type/Default.class.php b/type/Default.class.php
index eaf2e8e..b8650dc 100644
--- a/type/Default.class.php
+++ b/type/Default.class.php
@@ -235,15 +235,28 @@ class Type_Default {
235 235
236 $sources = $this->rrd_get_sources(); 236 $sources = $this->rrd_get_sources();
237 237
238 if ($this->scale)
239 $raw = '_raw';
238 $i=0; 240 $i=0;
239 foreach ($this->tinstances as $tinstance) { 241 foreach ($this->tinstances as $tinstance) {
240 foreach ($this->data_sources as $ds) { 242 foreach ($this->data_sources as $ds) {
241 $rrdgraph[] = sprintf('DEF:min_%s="%s":%s:MIN', crc32hex($sources[$i]), $this->rrd_escape($this->files[$tinstance]), $ds); 243 $rrdgraph[] = sprintf('DEF:min_%s%s="%s":%s:MIN', crc32hex($sources[$i]), $raw, $this->rrd_escape($this->files[$tinstance]), $ds);
242 $rrdgraph[] = sprintf('DEF:avg_%s="%s":%s:AVERAGE', crc32hex($sources[$i]), $this->rrd_escape($this->files[$tinstance]), $ds); 244 $rrdgraph[] = sprintf('DEF:avg_%s%s="%s":%s:AVERAGE', crc32hex($sources[$i]), $raw, $this->rrd_escape($this->files[$tinstance]), $ds);
243 $rrdgraph[] = sprintf('DEF:max_%s="%s":%s:MAX', crc32hex($sources[$i]), $this->rrd_escape($this->files[$tinstance]), $ds); 245 $rrdgraph[] = sprintf('DEF:max_%s%s="%s":%s:MAX', crc32hex($sources[$i]), $raw, $this->rrd_escape($this->files[$tinstance]), $ds);
244 $i++; 246 $i++;
245 } 247 }
246 } 248 }
249 if ($this->scale) {
250 $i=0;
251 foreach ($this->tinstances as $tinstance) {
252 foreach ($this->data_sources as $ds) {
253 $rrdgraph[] = sprintf('CDEF:min_%s=min_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale);
254 $rrdgraph[] = sprintf('CDEF:avg_%s=avg_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale);
255 $rrdgraph[] = sprintf('CDEF:max_%s=max_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale);
256 $i++;
257 }
258 }
259 }
247 260
248 if(count($this->files)<=1) { 261 if(count($this->files)<=1) {
249 $c = 0; 262 $c = 0;