aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/html.inc.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php
index 0a33da5..015225e 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -173,6 +173,8 @@ function host_summary($cat, $hosts) {
173 foreach($hosts as $host) { 173 foreach($hosts as $host) {
174 $host_counter++; 174 $host_counter++;
175 175
176 $cores = count(group_plugindata(collectd_plugindata($host, 'cpu')));
177
176 printf('<tr class="%s">', $row_style[$host_counter % 2]); 178 printf('<tr class="%s">', $row_style[$host_counter % 2]);
177 printf('<th><a href="%shost.php?h=%s">%s</a></th>', 179 printf('<th><a href="%shost.php?h=%s">%s</a></th>',
178 $CONFIG['weburl'],$host, $host); 180 $CONFIG['weburl'],$host, $host);
@@ -189,10 +191,15 @@ function host_summary($cat, $hosts) {
189 isset($rrd_info['ds[midterm].last_ds']) && 191 isset($rrd_info['ds[midterm].last_ds']) &&
190 isset($rrd_info['ds[longterm].last_ds'])) { 192 isset($rrd_info['ds[longterm].last_ds'])) {
191 193
192 printf('<td>%.2f</td><td>%.2f</td><td>%.2f</td>', 194 foreach (array('ds[shortterm].last_ds', 'ds[midterm].last_ds', 'ds[longterm].last_ds') as $info) {
193 $rrd_info['ds[shortterm].last_ds'], 195 $class = '';
194 $rrd_info['ds[midterm].last_ds'], 196 if ($cores > 0 && $rrd_info[$info] > $cores * 2)
195 $rrd_info['ds[longterm].last_ds']); 197 $class = ' class="crit"';
198 elseif ($cores > 0 && $rrd_info[$info] > $cores)
199 $class = ' class="warn"';
200
201 printf('<td%s>%.2f</td>', $class, $rrd_info[$info]);
202 }
196 } 203 }
197 } 204 }
198 205