Project

General

Profile

Download (3.07 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/usr/local/bin/php
2 4d875b4f Scott Ullrich
<?php
3 b46bfcf5 Bill Marquette
/* $Id$ */
4 5b237745 Scott Ullrich
/*
5
	diag_logs_dhcp.php
6 4d875b4f Scott Ullrich
	Copyright (C) 2004 Scott Ullrich
7
	All rights reserved.
8
9
	originially 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 4d875b4f 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 4d875b4f 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 4d875b4f 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 4d875b4f 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
$dhcpd_logfile = "{$g['varlog_path']}/dhcpd.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 {$dhcpd_logfile}");
45 5b237745 Scott Ullrich
}
46
47 b63695db Scott Ullrich
$pgtitle = "Diagnostics: System logs: DHCP";
48
include("head.inc");
49
50 5b237745 Scott Ullrich
?>
51
52
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
53
<?php include("fbegin.inc"); ?>
54 310b2c06 Bill Marquette
<p class="pgtitle"><?=$pgtitle?></p>
55 5b237745 Scott Ullrich
<table width="100%" border="0" cellpadding="0" cellspacing="0">
56
  <tr><td>
57 b63695db Scott Ullrich
<?php
58
	$tab_array = array();
59 9972f533 Bill Marquette
	$tab_array[] = array("System", false, "diag_logs.php");
60
	$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
61
	$tab_array[] = array("DHCP", true, "diag_logs_dhcp.php");
62
	$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
63
	$tab_array[] = array("IPSEC VPN", false, "diag_logs_ipsec.php");
64
	$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
65
	$tab_array[] = array("Load Balance", false, "diag_logs_slbd.php");
66
	$tab_array[] = array("Settings", false, "diag_logs_settings.php");
67 b63695db Scott Ullrich
	display_top_tabs($tab_array);
68
?>
69 5b237745 Scott Ullrich
  </td></tr>
70 4d875b4f Scott Ullrich
  <tr>
71 0f10aee4 Bill Marquette
    <td>
72
	<div id="mainarea">
73
		<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
74 4d875b4f Scott Ullrich
		  <tr>
75
			<td colspan="2" class="listtopic">
76 5b237745 Scott Ullrich
			  Last <?=$nentries;?> DHCP service log entries</td>
77
		  </tr>
78 963d5343 Bill Marquette
		  <?php dump_clog($dhcpd_logfile, $nentries); ?>
79 0f10aee4 Bill Marquette
		<tr><td><br><form action="diag_logs_dhcp.php" method="post">
80
<input name="clear" type="submit" class="formbtn" value="Clear log"></td></tr>
81 5b237745 Scott Ullrich
		</table>
82 0f10aee4 Bill Marquette
	</div>
83 5b237745 Scott Ullrich
</form>
84
	</td>
85
  </tr>
86
</table>
87
<?php include("fend.inc"); ?>
88 fa90d5f7 Scott Ullrich
<meta http-equiv="refresh" content="60;url=<?php print $_SERVER['PHP_SELF']; ?>">
89 5b237745 Scott Ullrich
</body>
90
</html>