Project

General

Profile

Download (3.19 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/usr/local/bin/php
2 cfc707f7 Scott Ullrich
<?php
3 b46bfcf5 Bill Marquette
/* $Id$ */
4 5b237745 Scott Ullrich
/*
5
	diag_logs.php
6 cfc707f7 Scott Ullrich
	Copyright (C) 2004 Scott Ullrich
7
	All rights reserved.
8
9
	originally part of m0n0wall (http://m0n0.ch/wall)
10 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
	All rights reserved.
12 cfc707f7 Scott Ullrich
13 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
14
	modification, are permitted provided that the following conditions are met:
15 cfc707f7 Scott Ullrich
16 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
17
	   this list of conditions and the following disclaimer.
18 cfc707f7 Scott Ullrich
19 5b237745 Scott Ullrich
	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 cfc707f7 Scott Ullrich
23 5b237745 Scott Ullrich
	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 963d5343 Bill Marquette
$system_logfile = "{$g['varlog_path']}/system.log";
38
39 5b237745 Scott Ullrich
$nentries = $config['syslog']['nentries'];
40
if (!$nentries)
41
	$nentries = 50;
42
43
if ($_POST['clear']) {
44 929d48cb Scott Ullrich
	exec("killall syslogd");
45 963d5343 Bill Marquette
	exec("/usr/sbin/clog -i -s 262144 {$system_logfile}");
46 929d48cb Scott Ullrich
	system_syslogd_start();	
47 5b237745 Scott Ullrich
}
48
49 b63695db Scott Ullrich
$pgtitle = "Diagnostics: System logs: System";
50
include("head.inc");
51
52 5b237745 Scott Ullrich
?>
53
54
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
55
<?php include("fbegin.inc"); ?>
56 310b2c06 Bill Marquette
<p class="pgtitle"><?=$pgtitle?></p>
57 5b237745 Scott Ullrich
<table width="100%" border="0" cellpadding="0" cellspacing="0">
58 0913a099 Erik Kristensen
	<tr>
59
		<td>
60 b63695db Scott Ullrich
<?php
61
	$tab_array = array();
62 9972f533 Bill Marquette
	$tab_array[] = array("System", true, "diag_logs.php");
63
	$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
64
	$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
65
	$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
66
	$tab_array[] = array("IPSEC VPN", false, "diag_logs_ipsec.php");
67
	$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
68
	$tab_array[] = array("Load Balance", false, "diag_logs_slbd.php");
69
	$tab_array[] = array("Settings", false, "diag_logs_settings.php");
70 b63695db Scott Ullrich
	display_top_tabs($tab_array);
71
?>
72 0913a099 Erik Kristensen
		</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
					<td colspan="2" class="listtopic">Last <?=$nentries;?> system log entries</td>
80
				</tr>
81 4ff29a45 Scott Ullrich
				<?php dump_clog($system_logfile, $nentries, true, "", array("racoon")); ?>
82 0913a099 Erik Kristensen
				<tr>
83
					<td>
84
						<br>
85
						<form action="diag_logs.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 5b237745 Scott Ullrich
</table>
95
<?php include("fend.inc"); ?>
96 fa90d5f7 Scott Ullrich
<meta http-equiv="refresh" content="60;url=<?php print $_SERVER['PHP_SELF']; ?>">
97 5b237745 Scott Ullrich
</body>
98
</html>