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