From 5c7fccfe8b5aa792f4adafa0c1281c69a8453fbc Mon Sep 17 00:00:00 2001 From: David Severwright Date: Thu, 11 Dec 2014 15:12:46 +0000 Subject: Adding option to show time since last update on dashboard. Closes #110 --- inc/html.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'inc') 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) { } } + if ($CONFIG['showtime']) { + $rrd_info = $rrd->rrd_info($CONFIG['datadir'].'/'.$host.'/load/load.rrd'); + $time = time() - $rrd_info['last_update']; + + $class = 'wide'; + if ($time > 300) + $class .= ' crit'; + elseif ($time > 60) + $class .= ' warn'; + + printf('%d seconds ago',$class, $time); + } + print "\n"; } -- cgit v1.1