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 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
35 |
|
|
##|*IDENT=page-diagnostics-logs-system
|
36 |
|
|
##|*NAME=Diagnostics: Logs: System page
|
37 |
|
|
##|*DESCR=Allow access to the 'Diagnostics: Logs: System' page.
|
38 |
|
|
##|*MATCH=diag_logs.php*
|
39 |
|
|
##|-PRIV
|
40 |
|
|
|
41 |
|
|
|
42 |
5b237745
|
Scott Ullrich
|
require("guiconfig.inc");
|
43 |
|
|
|
44 |
963d5343
|
Bill Marquette
|
$system_logfile = "{$g['varlog_path']}/system.log";
|
45 |
|
|
|
46 |
5b237745
|
Scott Ullrich
|
$nentries = $config['syslog']['nentries'];
|
47 |
|
|
if (!$nentries)
|
48 |
|
|
$nentries = 50;
|
49 |
|
|
|
50 |
|
|
if ($_POST['clear']) {
|
51 |
74772f9f
|
Scott Ullrich
|
if(isset($config['system']['disablesyslogclog'])) {
|
52 |
|
|
exec("killall syslogd");
|
53 |
|
|
unlink($syslog_logfile);
|
54 |
|
|
touch($syslog_logfile);
|
55 |
|
|
system_syslogd_start();
|
56 |
|
|
} else {
|
57 |
|
|
exec("killall syslogd");
|
58 |
|
|
exec("/usr/sbin/clog -i -s 262144 {$system_logfile}");
|
59 |
|
|
system_syslogd_start();
|
60 |
|
|
}
|
61 |
|
|
|
62 |
5b237745
|
Scott Ullrich
|
}
|
63 |
|
|
|
64 |
0541e302
|
Scott Ullrich
|
if ($_GET['filtertext'])
|
65 |
|
|
$filtertext = $_GET['filtertext'];
|
66 |
|
|
|
67 |
|
|
if ($_POST['filtertext'])
|
68 |
|
|
$filtertext = $_POST['filtertext'];
|
69 |
|
|
|
70 |
59769c23
|
Scott Ullrich
|
if ($filtertext)
|
71 |
36a166de
|
Scott Ullrich
|
$filtertextmeta="?filtertext=$filtertext";
|
72 |
59769c23
|
Scott Ullrich
|
|
73 |
d88c6a9f
|
Scott Ullrich
|
$pgtitle = array("Status","System logs","System");
|
74 |
b63695db
|
Scott Ullrich
|
include("head.inc");
|
75 |
|
|
|
76 |
5b237745
|
Scott Ullrich
|
?>
|
77 |
|
|
|
78 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
79 |
|
|
<?php include("fbegin.inc"); ?>
|
80 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
81 |
0913a099
|
Erik Kristensen
|
<tr>
|
82 |
|
|
<td>
|
83 |
b63695db
|
Scott Ullrich
|
<?php
|
84 |
|
|
$tab_array = array();
|
85 |
9972f533
|
Bill Marquette
|
$tab_array[] = array("System", true, "diag_logs.php");
|
86 |
|
|
$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
|
87 |
|
|
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
|
88 |
|
|
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
|
89 |
0f266b2e
|
Chris Buechler
|
$tab_array[] = array("IPsec VPN", false, "diag_logs_ipsec.php");
|
90 |
9972f533
|
Bill Marquette
|
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
|
91 |
ba0a9384
|
Scott Ullrich
|
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
|
92 |
03491df0
|
Scott Ullrich
|
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
|
93 |
18330d38
|
Scott Ullrich
|
$tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
|
94 |
9972f533
|
Bill Marquette
|
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
|
95 |
b63695db
|
Scott Ullrich
|
display_top_tabs($tab_array);
|
96 |
|
|
?>
|
97 |
0913a099
|
Erik Kristensen
|
</td>
|
98 |
|
|
</tr>
|
99 |
|
|
<tr>
|
100 |
|
|
<td>
|
101 |
|
|
<div id="mainarea">
|
102 |
|
|
<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
|
103 |
|
|
<tr>
|
104 |
|
|
<td colspan="2" class="listtopic">Last <?=$nentries;?> system log entries</td>
|
105 |
|
|
</tr>
|
106 |
0541e302
|
Scott Ullrich
|
<?php
|
107 |
|
|
if($filtertext)
|
108 |
|
|
dump_clog($system_logfile, $nentries, true, array("$filtertext"), array("racoon", "ntpd", "pppoe"));
|
109 |
|
|
else
|
110 |
|
|
dump_clog($system_logfile, $nentries, true, array(), array("racoon", "ntpd", "pppoe"));
|
111 |
|
|
?>
|
112 |
0913a099
|
Erik Kristensen
|
<tr>
|
113 |
0541e302
|
Scott Ullrich
|
<td align="left" valign="top">
|
114 |
|
|
<form id="filterform" name="filterform" action="diag_logs.php" method="post" style="margin-top: 14px;">
|
115 |
|
|
<input id="submit" name="clear" type="submit" class="formbtn" value="<?=gettext("Clear log");?>" />
|
116 |
|
|
</form>
|
117 |
|
|
</td>
|
118 |
|
|
<td align="right" valign="top" >
|
119 |
|
|
<form id="clearform" name="clearform" action="diag_logs.php" method="post" style="margin-top: 14px;">
|
120 |
|
|
<input id="filtertext" name="filtertext" value="<?=gettext($filtertext);?>" />
|
121 |
|
|
<input id="filtersubmit" name="filtersubmit" type="submit" class="formbtn" value="<?=gettext("Filter");?>" />
|
122 |
0913a099
|
Erik Kristensen
|
</form>
|
123 |
|
|
</td>
|
124 |
|
|
</tr>
|
125 |
|
|
</table>
|
126 |
|
|
</div>
|
127 |
|
|
</td>
|
128 |
|
|
</tr>
|
129 |
5b237745
|
Scott Ullrich
|
</table>
|
130 |
|
|
<?php include("fend.inc"); ?>
|
131 |
|
|
</body>
|
132 |
|
|
</html>
|