aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--inc/html.inc.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php
index 6ab84d9..c524e46 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -69,11 +69,25 @@ function host_summary($hosts) {
69 foreach($hosts as $host) { 69 foreach($hosts as $host) {
70 collectd_flush(sprintf('%s/load/load', $host)); 70 collectd_flush(sprintf('%s/load/load', $host));
71 $rrd_info = $rrd->rrd_info($CONFIG['datadir'].'/'.$host.'/load/load.rrd'); 71 $rrd_info = $rrd->rrd_info($CONFIG['datadir'].'/'.$host.'/load/load.rrd');
72
73 # ignore if file does not exist
72 if (!$rrd_info) 74 if (!$rrd_info)
73 continue; 75 continue;
74 printf('<tr><th><a href="%s/host.php?h=%s">%s</a></th><td>%.2f</td><td>%.2f</td><td>%.2f</td></tr>'."\n", 76
75 $CONFIG['weburl'],$host, $host, 77 printf('<tr><th><a href="%s/host.php?h=%s">%s</a></th>',
76 $rrd_info["ds[shortterm].last_ds"], $rrd_info["ds[midterm].last_ds"], $rrd_info["ds[longterm].last_ds"]); 78 $CONFIG['weburl'],$host, $host);
79
80 if (isset($rrd_info['ds[shortterm].last_ds']) &&
81 isset($rrd_info['ds[midterm].last_ds']) &&
82 isset($rrd_info['ds[longterm].last_ds'])) {
83
84 printf('<td>%.2f</td><td>%.2f</td><td>%.2f</td>',
85 $rrd_info['ds[shortterm].last_ds'],
86 $rrd_info['ds[midterm].last_ds'],
87 $rrd_info['ds[longterm].last_ds']);
88 }
89
90 print "</tr>\n";
77 } 91 }
78 92
79 echo "</table>\n"; 93 echo "</table>\n";