diff options
| -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 | } |
