1 |
32887d33
|
Scott Ullrich
|
#!/usr/local/bin/php
|
2 |
|
|
<?php
|
3 |
b46bfcf5
|
Bill Marquette
|
/* $Id$ */
|
4 |
32887d33
|
Scott Ullrich
|
/*
|
5 |
|
|
diag_logs.php
|
6 |
|
|
Copyright (C) 2004 Scott Ullrich
|
7 |
|
|
All rights reserved.
|
8 |
|
|
|
9 |
|
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
10 |
|
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
11 |
|
|
All rights reserved.
|
12 |
|
|
|
13 |
|
|
Redistribution and use in source and binary forms, with or without
|
14 |
|
|
modification, are permitted provided that the following conditions are met:
|
15 |
|
|
|
16 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
17 |
|
|
this list of conditions and the following disclaimer.
|
18 |
|
|
|
19 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
20 |
|
|
notice, this list of conditions and the following disclaimer in the
|
21 |
|
|
documentation and/or other materials provided with the distribution.
|
22 |
|
|
|
23 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
24 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
25 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
26 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
27 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
33 |
|
|
*/
|
34 |
|
|
|
35 |
|
|
require("guiconfig.inc");
|
36 |
|
|
|
37 |
039270ae
|
Colin Smith
|
$ipsec_logfile = "{$g['varlog_path']}/system.log";
|
38 |
963d5343
|
Bill Marquette
|
|
39 |
32887d33
|
Scott Ullrich
|
$nentries = $config['syslog']['nentries'];
|
40 |
|
|
if (!$nentries)
|
41 |
|
|
$nentries = 50;
|
42 |
|
|
|
43 |
|
|
if ($_POST['clear']) {
|
44 |
963d5343
|
Bill Marquette
|
exec("/usr/sbin/clog -i -s 262144 {$ipsec_logfile}");
|
45 |
32887d33
|
Scott Ullrich
|
}
|
46 |
|
|
|
47 |
b63695db
|
Scott Ullrich
|
$pgtitle = "Diagnostics: System logs: IPSEC VPN";
|
48 |
|
|
include("head.inc");
|
49 |
32887d33
|
Scott Ullrich
|
|
50 |
b63695db
|
Scott Ullrich
|
?>
|
51 |
32887d33
|
Scott Ullrich
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
52 |
|
|
<?php include("fbegin.inc"); ?>
|
53 |
963d5343
|
Bill Marquette
|
<p class="pgtitle">Diagnostics: System logs: IPSEC VPN</p>
|
54 |
12af52d9
|
Scott Ullrich
|
<div id="mainarea">
|
55 |
32887d33
|
Scott Ullrich
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
56 |
|
|
<tr><td>
|
57 |
b63695db
|
Scott Ullrich
|
<?php
|
58 |
|
|
$tab_array = array();
|
59 |
8ed15ffb
|
Scott Ullrich
|
$tab_array[0] = array("System", false, "diag_logs.php");
|
60 |
|
|
$tab_array[1] = array("Firewall", false, "diag_logs_filter.php");
|
61 |
|
|
$tab_array[2] = array("DHCP", false, "diag_logs_dhcp.php");
|
62 |
|
|
$tab_array[3] = array("Portal Auth", false, "diag_logs_auth.php");
|
63 |
|
|
$tab_array[4] = array("IPSEC VPN", true, "diag_logs_ipsec.php");
|
64 |
|
|
$tab_array[5] = array("PPTP VPN", false, "diag_logs_vpn.php");
|
65 |
|
|
$tab_array[6] = array("Settings", false, "diag_logs_settings.php");
|
66 |
b63695db
|
Scott Ullrich
|
display_top_tabs($tab_array);
|
67 |
|
|
?>
|
68 |
32887d33
|
Scott Ullrich
|
</td></tr>
|
69 |
|
|
<tr>
|
70 |
|
|
<td class="tabcont">
|
71 |
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
72 |
|
|
<tr>
|
73 |
|
|
<td colspan="2" class="listtopic">
|
74 |
963d5343
|
Bill Marquette
|
Last <?=$nentries;?> IPSEC log entries</td>
|
75 |
32887d33
|
Scott Ullrich
|
</tr>
|
76 |
b54c6fc7
|
Colin Smith
|
<?php dump_clog($ipsec_logfile, $nentries, true, array("racoon"), array(false)); ?>
|
77 |
32887d33
|
Scott Ullrich
|
</table>
|
78 |
|
|
<br><form action="diag_logs.php" method="post">
|
79 |
|
|
<input name="clear" type="submit" class="formbtn" value="Clear log">
|
80 |
|
|
</form>
|
81 |
|
|
</td>
|
82 |
|
|
</tr>
|
83 |
|
|
</table>
|
84 |
12af52d9
|
Scott Ullrich
|
</div>
|
85 |
32887d33
|
Scott Ullrich
|
<?php include("fend.inc"); ?>
|
86 |
12af52d9
|
Scott Ullrich
|
<script type="text/javascript">
|
87 |
|
|
NiftyCheck();
|
88 |
|
|
Rounded("div#mainarea","bl br","#FFF","#eeeeee","smooth");
|
89 |
|
|
</script>
|
90 |
|
|
|
91 |
32887d33
|
Scott Ullrich
|
</body>
|
92 |
|
|
</html>
|