diff options
| author | Manuel CISSÉ | 2010-02-23 17:01:35 +0100 |
|---|---|---|
| committer | Pim van den Berg | 2010-03-01 20:36:28 +0100 |
| commit | d008d392dc1efee963364925e90c198659d12fb0 (patch) | |
| tree | 14929967ec6069eac9a0ce9a78b0332d7367b8ba /type | |
| parent | add uptime plugin (diff) | |
| download | apt-panopticon_cgp-d008d392dc1efee963364925e90c198659d12fb0.zip apt-panopticon_cgp-d008d392dc1efee963364925e90c198659d12fb0.tar.gz apt-panopticon_cgp-d008d392dc1efee963364925e90c198659d12fb0.tar.bz2 apt-panopticon_cgp-d008d392dc1efee963364925e90c198659d12fb0.tar.xz | |
add the ability to graph multiple DS in multiple files (used by vmem plugin)
Diffstat (limited to 'type')
| -rw-r--r-- | type/Default.class.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/type/Default.class.php b/type/Default.class.php index 9e2e6b7..f15ca32 100644 --- a/type/Default.class.php +++ b/type/Default.class.php | |||
| @@ -149,7 +149,18 @@ class Type_Default { | |||
| 149 | $this->tinstances = array_intersect($this->order, $this->tinstances); | 149 | $this->tinstances = array_intersect($this->order, $this->tinstances); |
| 150 | } | 150 | } |
| 151 | # use tinstances as sources | 151 | # use tinstances as sources |
| 152 | $sources = $this->tinstances; | 152 | if(is_array($this->data_sources) && count($this->data_sources)>1) { |
| 153 | $sources = array(); | ||
| 154 | foreach($this->tinstances as $f) { | ||
| 155 | foreach($this->data_sources as $s) { | ||
| 156 | $sources[] = $f . '-' . $s; | ||
| 157 | } | ||
| 158 | } | ||
| 159 | } | ||
| 160 | else { | ||
| 161 | $sources = $this->tinstances; | ||
| 162 | } | ||
| 163 | $sources = str_replace('.', '_', $sources); | ||
| 153 | } | 164 | } |
| 154 | # or one file with multiple data_sources | 165 | # or one file with multiple data_sources |
| 155 | else { | 166 | else { |
| @@ -182,7 +193,7 @@ class Type_Default { | |||
| 182 | } | 193 | } |
| 183 | } | 194 | } |
| 184 | 195 | ||
| 185 | foreach($sources as $source) { | 196 | foreach ($sources as $source) { |
| 186 | $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source; | 197 | $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source; |
| 187 | $color = is_array($this->colors) ? $this->colors[$source]: $this->colors; | 198 | $color = is_array($this->colors) ? $this->colors[$source]: $this->colors; |
| 188 | $rrdgraph[] = sprintf('LINE1:avg_%s#%s:\'%s\'', crc32hex($source), $this->validate_color($color), $dsname); | 199 | $rrdgraph[] = sprintf('LINE1:avg_%s#%s:\'%s\'', crc32hex($source), $this->validate_color($color), $dsname); |
