diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2007-08-10 14:52:15 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2007-08-10 14:52:15 +0000 |
commit | 4a2e189b9982791c8947c122d8adf6555f7b7cd3 (patch) | |
tree | bbf9d7abe4fcfac77b329ee10779d8eda64d2c79 /usr | |
parent | 9c2605519ce8db04e7570ee7361d0a44f05c5db1 (diff) | |
download | pfsense-4a2e189b9982791c8947c122d8adf6555f7b7cd3.zip pfsense-4a2e189b9982791c8947c122d8adf6555f7b7cd3.tar.gz |
Provide a different approach to showing logfiles. This allows for highlighting specific information and also provide
the ability to show other information.
For the ipsec logs this means we now show the tunnel description in bold for each identified gateway ip.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/diag_logs_ipsec.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php index 0d8cf69..6a4a117 100755 --- a/usr/local/www/diag_logs_ipsec.php +++ b/usr/local/www/diag_logs_ipsec.php @@ -34,6 +34,16 @@ require("guiconfig.inc"); $ipsec_logfile = "{$g['varlog_path']}/ipsec.log"; +$ipsec_logarr = return_clog($ipsec_logfile, $nentries); + +/* Create array with all IPSEC tunnel descriptions */ +$search = array(); +$replace = array(); +foreach($config['ipsec']['tunnel'] as $tunnel) { + $gateway = "{$tunnel['remote-gateway']}"; + $search[] = "/(racoon: )([A-Z:].*?)({$gateway}\[[0-9].+\]|{$gateway})/i"; + $replace[] = "$1<strong>[{$tunnel['descr']}]</strong>: $2$3$4"; +} $nentries = $config['syslog']['nentries']; if (!$nentries) @@ -78,7 +88,17 @@ include("head.inc"); <tr> <td colspan="2" class="listtopic">Last <?=$nentries;?> IPSEC log entries</td> </tr> - <?php dump_clog($ipsec_logfile, $nentries); ?> + <?php + foreach($ipsec_logarr as $logent){ + $logent = preg_replace($search, $replace, $logent); + $logent = preg_split("/\s+/", $logent, 6); + echo "<tr valign=\"top\">\n"; + $entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3))); + echo "<td class=\"listlr\" nowrap>" . $entry_date_time . "</td>\n"; + echo "<td class=\"listr\">" . $logent[4] . " " . $logent[5] . "</td>\n"; + echo "</tr>\n"; + } + ?> <tr> <td> <br> |