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 | |
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-- | conf/config.php | 1 | ||||
-rw-r--r-- | inc/html.inc.php | 13 | ||||
-rw-r--r-- | layout/style.css | 5 |
3 files changed, 19 insertions, 0 deletions
diff --git a/conf/config.php b/conf/config.php index 157012a..ec55d30 100644 --- a/conf/config.php +++ b/conf/config.php | |||
@@ -32,6 +32,7 @@ $CONFIG['time_range']['uptime'] = 31536000; | |||
32 | # show load averages and used memory on overview page | 32 | # show load averages and used memory on overview page |
33 | $CONFIG['showload'] = true; | 33 | $CONFIG['showload'] = true; |
34 | $CONFIG['showmem'] = false; | 34 | $CONFIG['showmem'] = false; |
35 | $CONFIG['showtime'] = false; | ||
35 | 36 | ||
36 | $CONFIG['term'] = array( | 37 | $CONFIG['term'] = array( |
37 | '2hour' => 3600 * 2, | 38 | '2hour' => 3600 * 2, |
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 | ||
diff --git a/layout/style.css b/layout/style.css index 19ec77e..1360b36 100644 --- a/layout/style.css +++ b/layout/style.css | |||
@@ -68,6 +68,11 @@ table.summary td { | |||
68 | text-align: right; | 68 | text-align: right; |
69 | } | 69 | } |
70 | 70 | ||
71 | table.summary td.wide { | ||
72 | width: 200px; | ||
73 | text-align: right; | ||
74 | } | ||
75 | |||
71 | img { | 76 | img { |
72 | border: 0; | 77 | border: 0; |
73 | } | 78 | } |