diff options
| author | David Severwright | 2014-12-11 15:12:46 +0000 |
|---|---|---|
| committer | Pim van den Berg | 2014-12-13 13:43:06 +0100 |
| commit | 5c7fccfe8b5aa792f4adafa0c1281c69a8453fbc (patch) | |
| tree | 54f5b1339896dbe3e78ce37b362f9028ed197ec1 /inc/html.inc.php | |
| parent | js/CGP: scroll wheel zoom center position (diff) | |
| download | apt-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 '')
| -rw-r--r-- | inc/html.inc.php | 13 |
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 | ||
