Project

General

Profile

Download (4.07 KB) Statistics
| Branch: | Tag: | Revision:
1 cfc707f7 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	diag_logs.php
5 cfc707f7 Scott Ullrich
	Copyright (C) 2004 Scott Ullrich
6
	All rights reserved.
7
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11 cfc707f7 Scott Ullrich
12 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14 cfc707f7 Scott Ullrich
15 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17 cfc707f7 Scott Ullrich
18 5b237745 Scott Ullrich
	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 cfc707f7 Scott Ullrich
22 5b237745 Scott Ullrich
	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
require("guiconfig.inc");
35
36 963d5343 Bill Marquette
$system_logfile = "{$g['varlog_path']}/system.log";
37
38 5b237745 Scott Ullrich
$nentries = $config['syslog']['nentries'];
39
if (!$nentries)
40
	$nentries = 50;
41
42
if ($_POST['clear']) {
43 929d48cb Scott Ullrich
	exec("killall syslogd");
44 963d5343 Bill Marquette
	exec("/usr/sbin/clog -i -s 262144 {$system_logfile}");
45 18330d38 Scott Ullrich
	system_syslogd_start();
46 5b237745 Scott Ullrich
}
47
48 0541e302 Scott Ullrich
if ($_GET['filtertext'])
49
	$filtertext = $_GET['filtertext'];
50
51
if ($_POST['filtertext'])
52
	$filtertext = $_POST['filtertext'];
53
54 59769c23 Scott Ullrich
if ($filtertext)
55 36a166de Scott Ullrich
	$filtertextmeta="?filtertext=$filtertext";
56 59769c23 Scott Ullrich
57 b63695db Scott Ullrich
$pgtitle = "Diagnostics: System logs: System";
58
include("head.inc");
59
60 5b237745 Scott Ullrich
?>
61
62
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
63
<?php include("fbegin.inc"); ?>
64 310b2c06 Bill Marquette
<p class="pgtitle"><?=$pgtitle?></p>
65 5b237745 Scott Ullrich
<table width="100%" border="0" cellpadding="0" cellspacing="0">
66 0913a099 Erik Kristensen
	<tr>
67
		<td>
68 b63695db Scott Ullrich
<?php
69
	$tab_array = array();
70 9972f533 Bill Marquette
	$tab_array[] = array("System", true, "diag_logs.php");
71
	$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
72
	$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
73
	$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
74
	$tab_array[] = array("IPSEC VPN", false, "diag_logs_ipsec.php");
75
	$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
76 ba0a9384 Scott Ullrich
	$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
77 03491df0 Scott Ullrich
	$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
78 18330d38 Scott Ullrich
	$tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
79 9972f533 Bill Marquette
	$tab_array[] = array("Settings", false, "diag_logs_settings.php");
80 b63695db Scott Ullrich
	display_top_tabs($tab_array);
81
?>
82 0913a099 Erik Kristensen
		</td>
83
	</tr>
84
	<tr>
85
		<td>
86
			<div id="mainarea">
87
			<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
88
				<tr>
89
					<td colspan="2" class="listtopic">Last <?=$nentries;?> system log entries</td>
90
				</tr>
91 0541e302 Scott Ullrich
				<?php
92
					if($filtertext)
93
						dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("racoon", "ntpd", "pppoe"));
94
					else
95
						dump_clog($system_logfile, $nentries, true, array(), array("racoon", "ntpd", "pppoe"));
96
				?>
97 0913a099 Erik Kristensen
				<tr>
98 0541e302 Scott Ullrich
					<td align="left" valign="top">
99
						<form id="filterform" name="filterform" action="diag_logs.php" method="post" style="margin-top: 14px;">
100
              				<input id="submit" name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log");?>" />
101
						</form>
102
					</td>
103
					<td align="right" valign="top" >
104
						<form id="clearform" name="clearform" action="diag_logs.php" method="post" style="margin-top: 14px;">
105
              				<input id="filtertext" name="filtertext" value="<?=gettext($filtertext);?>" />
106
              				<input id="filtersubmit" name="filtersubmit" type="submit" class="formbtn" value="<?=gettext("Filter");?>" />
107 0913a099 Erik Kristensen
						</form>
108
					</td>
109
				</tr>
110
			</table>
111
	    	</div>
112
		</td>
113
	</tr>
114 5b237745 Scott Ullrich
</table>
115
<?php include("fend.inc"); ?>
116
</body>
117
</html>