aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc
diff options
context:
space:
mode:
authorDavid Severwright2014-12-11 15:12:46 +0000
committerPim van den Berg2014-12-13 13:43:06 +0100
commit5c7fccfe8b5aa792f4adafa0c1281c69a8453fbc (patch)
tree54f5b1339896dbe3e78ce37b362f9028ed197ec1 /inc
parentjs/CGP: scroll wheel zoom center position (diff)
downloadapt-panopticon_cgp-5c7fccfe8b5aa792f4adafa0c1281c69a8453fbc.zip
apt-panopticon_cgp-5c7fccfe8b5aa792f4adafa0c1281c69a8453fbc.tar.gz
apt-panopticon_cgp-5c7fccfe8b5aa792f4adafa0c1281c69a8453fbc.tar.bz2
apt-panopticon_cgp-5c7fccfe8b5aa792f4adafa0c1281c69a8453fbc.tar.xz
Adding option to show time since last update on dashboard.
Closes #110
Diffstat (limited to 'inc')
-rw-r--r--inc/html.inc.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/inc/html.inc.php b/inc/html.inc.php
index bc22ba3..a263a58 100644
--- a/inc/html.inc.php
+++ b/inc/html.inc.php
@@ -281,6 +281,19 @@ function host_summary($cat, $hosts) {
281 } 281 }
282 } 282 }
283 283
284 if ($CONFIG['showtime']) {
285 $rrd_info = $rrd->rrd_info($CONFIG['datadir'].'/'.$host.'/load/load.rrd');
286 $time = time() - $rrd_info['last_update'];
287
288 $class = 'wide';
289 if ($time > 300)
290 $class .= ' crit';
291 elseif ($time > 60)
292 $class .= ' warn';
293
294 printf('<td class="%s">%d seconds ago</td>',$class, $time);
295 }
296
284 print "</tr>\n"; 297 print "</tr>\n";
285 } 298 }
286 299