Project

General

Profile

Download (3.5 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 6b07c15a Matthew Grooms
##|+PRIV
35
##|*IDENT=page-status-systemlogs-openvpn
36
##|*NAME=Status: System logs: OpenVPN page
37
##|*DESCR=Allow access to the 'Status: System logs: OpenVPN' page.
38
##|*MATCH=diag_logs_openvpn.php*
39
##|-PRIV
40
41
42 d88c6a9f Scott Ullrich
$pgtitle = array("Status","System logs","OpenVPN");
43 e35011e0 Scott Ullrich
44
require("guiconfig.inc");
45
46
$openvpn_logfile = "{$g['varlog_path']}/openvpn.log";
47
48
$nentries = $config['syslog']['nentries'];
49
if (!$nentries)
50
	$nentries = 50;
51
52
if ($_POST['clear']) {
53 74772f9f Scott Ullrich
	if(isset($config['system']['disablesyslogclog'])) {
54
		unlink($openvpn_logfile);
55
		touch($openvpn_logfile);
56
	} else {
57
		exec("killall syslogd");
58
		exec("/usr/sbin/clog -i -s 262144 {$openvpn_logfile}");
59
		system_syslogd_start();
60
	}
61 e35011e0 Scott Ullrich
}
62
63
include("head.inc");
64
65
?>
66
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
67
<?php include("fbegin.inc"); ?>
68
<table width="100%" border="0" cellpadding="0" cellspacing="0">
69
 	<tr>
70
		<td>
71
<?php
72
	$tab_array = array();
73
	$tab_array[] = array("System", false, "diag_logs.php");
74
	$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
75
	$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
76
	$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
77 0f266b2e Chris Buechler
	$tab_array[] = array("IPsec VPN", false, "diag_logs_ipsec.php");
78 e35011e0 Scott Ullrich
	$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
79 1348a09b Seth Mos
	$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
80 e35011e0 Scott Ullrich
	$tab_array[] = array("OpenVPN", true, "diag_logs_openvpn.php");
81 18330d38 Scott Ullrich
	$tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
82 e35011e0 Scott Ullrich
	$tab_array[] = array("Settings", false, "diag_logs_settings.php");
83
	display_top_tabs($tab_array);
84
?>
85
  		</td>
86
	</tr>
87
	<tr>
88
    	<td>
89
			<div id="mainarea">
90
			<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
91
		  		<tr>
92 06f3935e Scott Ullrich
					<td colspan="2" class="listtopic">Last <?=$nentries;?> OpenVPN log entries</td>
93 e35011e0 Scott Ullrich
		  		</tr>
94 08b4068f Scott Ullrich
				<?php dump_clog($openvpn_logfile, $nentries); ?>
95 e35011e0 Scott Ullrich
				<tr>
96
					<td>
97
						<br>
98
						<form action="diag_logs_openvpn.php" method="post">
99
						<input name="clear" type="submit" class="formbtn" value="Clear log">
100
						</form>
101
					</td>
102
				</tr>
103
			</table>
104
			</div>
105
		</td>
106
	</tr>
107
</table>
108
<?php include("fend.inc"); ?>
109
</body>
110
</html>