Project

General

Profile

Download (3.09 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 963d5343 Bill Marquette
	exec("/usr/sbin/clog -i -s 262144 {$system_logfile}");
45 5b237745 Scott Ullrich
}
46
47
?>
48
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
49
<html>
50
<head>
51 963d5343 Bill Marquette
<title><?=gentitle("Diagnostics: System logs: System");?></title>
52 5b237745 Scott Ullrich
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
53
<link href="gui.css" rel="stylesheet" type="text/css">
54
</head>
55
56
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
57
<?php include("fbegin.inc"); ?>
58 963d5343 Bill Marquette
<p class="pgtitle">Diagnostics: System logs: System</p>
59 5b237745 Scott Ullrich
<table width="100%" border="0" cellpadding="0" cellspacing="0">
60
  <tr><td>
61
  <ul id="tabnav">
62 32887d33 Scott Ullrich
    <li class="tabact">System</li>
63 824b7b12 Scott Ullrich
    <li class="tabinact"><a href="diag_logs_filter.php">Firewall</a></li>
64 5b237745 Scott Ullrich
    <li class="tabinact"><a href="diag_logs_dhcp.php">DHCP</a></li>
65 3f2b92d2 Scott Ullrich
    <li class="tabinact"><a href="diag_logs_auth.php">Portal Auth</a></li>
66 963d5343 Bill Marquette
    <li class="tabinact"><a href="diag_logs_ipsec.php">IPSEC VPN</a></li>
67 5b237745 Scott Ullrich
    <li class="tabinact"><a href="diag_logs_vpn.php">PPTP VPN</a></li>
68
    <li class="tabinact"><a href="diag_logs_settings.php">Settings</a></li>
69
  </ul>
70
  </td></tr>
71 cfc707f7 Scott Ullrich
  <tr>
72 5b237745 Scott Ullrich
    <td class="tabcont">
73
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
74 cfc707f7 Scott Ullrich
		  <tr>
75
			<td colspan="2" class="listtopic">
76 5b237745 Scott Ullrich
			  Last <?=$nentries;?> system log entries</td>
77
		  </tr>
78 a803dcfd Colin Smith
		  <?php dump_clog($system_logfile, $nentries); ?>
79 5b237745 Scott Ullrich
		</table>
80
		<br><form action="diag_logs.php" method="post">
81
<input name="clear" type="submit" class="formbtn" value="Clear log">
82
</form>
83
	</td>
84
  </tr>
85
</table>
86
<?php include("fend.inc"); ?>
87
</body>
88
</html>