Project

General

Profile

Download (4.38 KB) Statistics
| Branch: | Tag: | Revision:
1 cfc707f7 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	diag_logs.php
5 13d193c2 Scott Ullrich
	Copyright (C) 2004-2009 Scott Ullrich
6 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7 cfc707f7 Scott Ullrich
	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 13d193c2 Scott Ullrich
/*		
36
	pfSense_MODULE:	system
37
*/
38
39 6b07c15a Matthew Grooms
##|+PRIV
40
##|*IDENT=page-diagnostics-logs-system
41
##|*NAME=Diagnostics: Logs: System page
42
##|*DESCR=Allow access to the 'Diagnostics: Logs: System' page.
43
##|*MATCH=diag_logs.php*
44
##|-PRIV
45
46 5b237745 Scott Ullrich
require("guiconfig.inc");
47
48 963d5343 Bill Marquette
$system_logfile = "{$g['varlog_path']}/system.log";
49
50 5b237745 Scott Ullrich
$nentries = $config['syslog']['nentries'];
51
if (!$nentries)
52
	$nentries = 50;
53
54 d6abaa18 Scott Ullrich
if ($_POST['clear']) 
55
	clear_log_file($system_logfile);
56 5b237745 Scott Ullrich
57 0541e302 Scott Ullrich
if ($_GET['filtertext'])
58 daab67a1 Scott Ullrich
	$filtertext = htmlspecialchars($_GET['filtertext']);
59 0541e302 Scott Ullrich
60
if ($_POST['filtertext'])
61 daab67a1 Scott Ullrich
	$filtertext = htmlspecialchars($_POST['filtertext']);
62 0541e302 Scott Ullrich
63 59769c23 Scott Ullrich
if ($filtertext)
64 36a166de Scott Ullrich
	$filtertextmeta="?filtertext=$filtertext";
65 59769c23 Scott Ullrich
66 e0977fed smos
$pgtitle = array(gettext("Status"),gettext("System logs"),gettext("General"));
67 b63695db Scott Ullrich
include("head.inc");
68
69 33d52df1 sbeaver
$tab_array = array();
70
$tab_array[] = array(gettext("System"), true, "diag_logs.php");
71
$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
72
$tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
73
$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
74
$tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
75
$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
76
$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
77
$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
78
$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
79
$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
80
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
81
display_top_tabs($tab_array);
82
83
$tab_array = array();
84
$tab_array[] = array(gettext("General"), true, "/diag_logs.php");
85
$tab_array[] = array(gettext("Gateways"), false, "/diag_logs_gateways.php");
86
$tab_array[] = array(gettext("Routing"), false, "/diag_logs_routing.php");
87
$tab_array[] = array(gettext("Resolver"), false, "/diag_logs_resolver.php");
88
$tab_array[] = array(gettext("Wireless"), false, "/diag_logs_wireless.php");
89
display_top_tabs($tab_array, false, 'nav nav-tabs');
90
91
require('classes/Form.class.php');
92
93
$form = new Form(false);
94
95
$section = new Form_Section('Log file filter');
96
97
$section->addInput(new Form_Input(
98
	'filtertext',
99
	'Filter',
100
	'text',
101
	$filtertext,
102
	['placeholder' => 'Filter text']
103
));
104
105
$form->addGlobal(new Form_Button(
106
	'filtersubmit',
107
	'Filter'
108 201c0361 sbeaver
))->removeClass('btn-primary')->addClass('btn-default')->addClass('btn-sm');
109 33d52df1 sbeaver
110
$form->addGlobal(new Form_Button(
111
	'clear',
112
	'Clear log'
113 201c0361 sbeaver
))->removeClass('btn-primary')->addClass('btn-danger')->addClass('btn-sm');
114 33d52df1 sbeaver
115
$form->add($section);
116
print $form;
117 5b237745 Scott Ullrich
118 e0977fed smos
?>
119 33d52df1 sbeaver
    <div class="panel panel-default">
120
        <div class="panel-heading"><?=gettext("Last ")?><?=$nentries?><?=gettext(" log entries")?></div>
121
	    <pre>
122 e0977fed smos
<?php
123 33d52df1 sbeaver
    	if($filtertext)
124
    		dump_clog_no_table($system_logfile, $nentries, true, array("$filtertext"), array("ppp"));
125
    	else
126
    		dump_clog_no_table($system_logfile, $nentries, true, array(), array("ppp"));
127 b63695db Scott Ullrich
?>
128 33d52df1 sbeaver
    	</pre>
129
	</div>
130
131
<?php include("foot.inc"); ?>