Project

General

Profile

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