summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/diag_logs.php3
-rwxr-xr-xusr/local/www/diag_logs_auth.php1
-rwxr-xr-xusr/local/www/diag_logs_dhcp.php1
-rwxr-xr-xusr/local/www/diag_logs_filter.php1
-rwxr-xr-xusr/local/www/diag_logs_filter_dynamic.php51
-rwxr-xr-xusr/local/www/diag_logs_ipsec.php3
-rw-r--r--usr/local/www/diag_logs_ntpd.php92
-rw-r--r--usr/local/www/diag_logs_openvpn.php1
-rwxr-xr-xusr/local/www/diag_logs_settings.php1
-rwxr-xr-xusr/local/www/diag_logs_slbd.php3
-rwxr-xr-xusr/local/www/diag_logs_vpn.php23
11 files changed, 141 insertions, 39 deletions
diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php
index bf5e29c..c28038f 100755
--- a/usr/local/www/diag_logs.php
+++ b/usr/local/www/diag_logs.php
@@ -42,7 +42,7 @@ if (!$nentries)
if ($_POST['clear']) {
exec("killall syslogd");
exec("/usr/sbin/clog -i -s 262144 {$system_logfile}");
- system_syslogd_start();
+ system_syslogd_start();
}
$pgtitle = "Diagnostics: System logs: System";
@@ -66,6 +66,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_auth.php b/usr/local/www/diag_logs_auth.php
index b7805d7..230006f 100755
--- a/usr/local/www/diag_logs_auth.php
+++ b/usr/local/www/diag_logs_auth.php
@@ -61,6 +61,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_dhcp.php b/usr/local/www/diag_logs_dhcp.php
index 0e85073..0f40276 100755
--- a/usr/local/www/diag_logs_dhcp.php
+++ b/usr/local/www/diag_logs_dhcp.php
@@ -63,6 +63,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index 6871117..2103ffa 100755
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -190,6 +190,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_filter_dynamic.php b/usr/local/www/diag_logs_filter_dynamic.php
index 4b97005..a447724 100755
--- a/usr/local/www/diag_logs_filter_dynamic.php
+++ b/usr/local/www/diag_logs_filter_dynamic.php
@@ -44,7 +44,7 @@ if (!$nentries)
if ($_POST['clear']) {
exec("killall syslogd");
exec("/usr/sbin/clog -i -s 262144 /var/log/filter.log");
- system_syslogd_start();
+ system_syslogd_start();
}
/* format filter logs */
@@ -62,7 +62,7 @@ function conv_clog_filter($logfile, $tail = 50) {
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
- $logarr = "";
+ $logarr = "";
exec("/usr/sbin/clog {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
$filterlog = array();
@@ -71,17 +71,17 @@ function conv_clog_filter($logfile, $tail = 50) {
foreach ($logarr as $logent) {
- if($counter > $nentries)
+ if($counter > $nentries)
break;
$log_split = "";
-
+
preg_match("/(.*)\s.*\spf:\s.*\srule\s(.*)\(match\)\:\s(.*)\s\w+\son\s(\w+)\:\s(.*)\s>\s(.*)\:\s.*/", $logent, $log_split);
-
+
$logent = strtoupper($logent);
$do_not_display = false;
-
+
if(stristr(strtoupper($logent), "UDP") == true)
$flent['proto'] = "UDP";
else if(stristr(strtoupper($logent), "TCP") == true)
@@ -89,9 +89,9 @@ function conv_clog_filter($logfile, $tail = 50) {
else if(stristr(strtoupper($logent), "ICMP") == true)
$flent['proto'] = "ICMP";
else if(stristr(strtoupper($logent), "HSRP") == true)
- $flent['proto'] = "HSRP";
+ $flent['proto'] = "HSRP";
else if(stristr(strtoupper($logent), "ESP") == true)
- $flent['proto'] = "ESP";
+ $flent['proto'] = "ESP";
else if(stristr(strtoupper($logent), "AH") == true)
$flent['proto'] = "AH";
else if(stristr(strtoupper($logent), "GRE") == true)
@@ -104,23 +104,23 @@ function conv_clog_filter($logfile, $tail = 50) {
$flent['proto'] = "PFSYNC";
else
$do_not_display = true;
-
+
$flent['time'] = $log_split[1];
$flent['act'] = $log_split[3];
-
+
$friendly_int = convert_real_interface_to_friendly_interface_name($log_split[4]);
-
+
$flent['interface'] = strtoupper($friendly_int);
-
+
if($config['interfaces'][$friendly_int]['descr'] <> "")
$flent['interface'] = "{$config['interfaces'][$friendly_int]['descr']}";
-
+
$flent['src'] = convert_port_period_to_colon($log_split[5]);
$flent['dst'] = convert_port_period_to_colon($log_split[6]);
-
+
$tmp = split("/", $log_split[2]);
$flent['rulenum'] = $tmp[0];
-
+
$counter++;
$filterlog[] = $flent;
@@ -196,6 +196,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
@@ -205,7 +206,7 @@ include("head.inc");
<div id="mainarea">
<div class="listtopic">
Last <?php echo $nentries; ?> records
- </div>
+ </div>
<div id="log">
<div class="log-header">
<span class="log-action">Act</span>
@@ -213,7 +214,7 @@ include("head.inc");
<span class="log-interface">If</span>
<span class="log-source">Source</span>
<span class="log-destination">Destination</span>
- <span class="log-protocol">Proto</span>
+ <span class="log-protocol">Proto</span>
</div>
<?php $counter=0; foreach ($filterlog as $filterent): ?>
<?php
@@ -226,13 +227,13 @@ include("head.inc");
} else {
/* non-reverse logging */
- if($counter == count($filterlog))
+ if($counter == count($filterlog))
$activerow = " id=\"firstrow\"";
else
$activerow = "";
}
?>
- <div class="log-entry" <?php echo $activerow; ?>>
+ <div class="log-entry" <?php echo $activerow; ?>>
<span class="log-action" nowrap><a href="#" onClick="javascript:getURL('diag_logs_filter.php?getrulenum=<?php echo $filterent['rulenum']; ?>', outputrule);">
<?php
if (strstr(strtolower($filterent['act']), "p"))
@@ -280,7 +281,7 @@ if (typeof getURL == 'undefined') {
}
}
if (!http_request)
- throw 'Both getURL and XMLHttpRequest are undefined';
+ throw 'Both getURL and XMLHttpRequest are undefined';
http_request.onreadystatechange = function() {
if (http_request.readyState == 4) {
callback( { success : true,
@@ -340,7 +341,7 @@ function update_div_rows(data) {
var showanim = 1;
if (isIE) {
showanim = 0;
- }
+ }
for(var x=1; x<data.length; x++) {
var numrows = rows.length;
/* if reverse logging is enabled we need to show the
@@ -356,7 +357,7 @@ function update_div_rows(data) {
for (var i = 2; i < numrows - 1; i++) {
nextrecord = i + 1;
rows[i].innerHTML = rows[nextrecord].innerHTML;
- }
+ }
}
var item = document.getElementById('firstrow');
if (showanim) {
@@ -398,7 +399,7 @@ function handle_ajax() {
echo "The rule that triggered this action is:\n\n{$rule}";
exit;
}
-
+
if($_GET['lastsawtime'] or $_POST['lastsawtime']) {
global $filter_logfile,$filterent;
if($_GET['lastsawtime'])
@@ -408,7 +409,7 @@ function handle_ajax() {
/* compare lastsawrule's time stamp to filter logs.
* afterwards return the newer records so that client
* can update AJAX interface screen.
- */
+ */
$new_rules = "";
$filterlog = conv_clog_filter($filter_logfile, 50);
foreach($filterlog as $log_row) {
@@ -427,7 +428,7 @@ function handle_ajax() {
}
echo $new_rules;
exit;
- }
+ }
}
?> \ No newline at end of file
diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php
index ea28690..0d8cf69 100755
--- a/usr/local/www/diag_logs_ipsec.php
+++ b/usr/local/www/diag_logs_ipsec.php
@@ -42,7 +42,7 @@ if (!$nentries)
if ($_POST['clear']) {
exec("killall syslogd");
exec("/usr/sbin/clog -i -s 262144 {$ipsec_logfile}");
- system_syslogd_start();
+ system_syslogd_start();
}
$pgtitle = "Diagnostics: System logs: IPSEC VPN";
@@ -65,6 +65,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_ntpd.php b/usr/local/www/diag_logs_ntpd.php
new file mode 100644
index 0000000..7d4f9b4
--- /dev/null
+++ b/usr/local/www/diag_logs_ntpd.php
@@ -0,0 +1,92 @@
+<?php
+/* $Id$ */
+/*
+ diag_logs_ntpd.php
+ part of pfSense
+ Copyright (C) 2005 Bill Marquette <bill.marquette@gmail.com>.
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+
+$slbd_logfile = "{$g['varlog_path']}/ntpd.log";
+
+$nentries = $config['syslog']['nentries'];
+if (!$nentries)
+ $nentries = 50;
+
+if ($_POST['clear']) {
+ exec("killall syslogd");
+ exec("/usr/sbin/clog -i -s 262144 {$slbd_logfile}");
+ system_syslogd_start();
+}
+
+$pgtitle = "Diagnostics: System logs: Load Balancer";
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle"><?=$pgtitle?></p>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+<?php
+ $tab_array = array();
+ $tab_array[] = array("System", false, "diag_logs.php");
+ $tab_array[] = array("Firewall", false, "diag_logs_filter.php");
+ $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
+ $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
+ $tab_array[] = array("IPSEC VPN", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
+ $tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
+ $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", true, "diag_logs_ntpd.php");
+ $tab_array[] = array("Settings", false, "diag_logs_settings.php");
+ display_top_tabs($tab_array);
+?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2" class="listtopic">
+ Last <?=$nentries;?> Load Balancer log entries</td>
+ </tr>
+ <?php dump_clog($slbd_logfile, $nentries); ?>
+ <tr><td><br>
+ <form action="diag_logs_slbd.php" method="post">
+ <input name="clear" type="submit" class="formbtn" value="Clear log"></td></tr>
+ </table>
+ </div>
+</form>
+ </td>
+ </tr>
+</table>
+<?php include("fend.inc"); ?>
+<meta http-equiv="refresh" content="60;url=<?php print $_SERVER['SCRIPT_NAME']; ?>">
+</body>
+</html>
diff --git a/usr/local/www/diag_logs_openvpn.php b/usr/local/www/diag_logs_openvpn.php
index 84a44f7..9810ef0 100644
--- a/usr/local/www/diag_logs_openvpn.php
+++ b/usr/local/www/diag_logs_openvpn.php
@@ -66,6 +66,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", true, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php
index c153f41..ddeb6a7 100755
--- a/usr/local/www/diag_logs_settings.php
+++ b/usr/local/www/diag_logs_settings.php
@@ -138,6 +138,7 @@ function enable_change(enable_over) {
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", true, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_slbd.php b/usr/local/www/diag_logs_slbd.php
index ac1fff0..81e8866 100755
--- a/usr/local/www/diag_logs_slbd.php
+++ b/usr/local/www/diag_logs_slbd.php
@@ -41,7 +41,7 @@ if (!$nentries)
if ($_POST['clear']) {
exec("killall syslogd");
exec("/usr/sbin/clog -i -s 262144 {$slbd_logfile}");
- system_syslogd_start();
+ system_syslogd_start();
}
$pgtitle = "Diagnostics: System logs: Load Balancer";
@@ -64,6 +64,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", true, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
diff --git a/usr/local/www/diag_logs_vpn.php b/usr/local/www/diag_logs_vpn.php
index 9bd3b1d..ffcf4b1 100755
--- a/usr/local/www/diag_logs_vpn.php
+++ b/usr/local/www/diag_logs_vpn.php
@@ -1,22 +1,22 @@
#!/usr/local/bin/php
-<?php
+<?php
/*
diag_logs_vpn.php
part of m0n0wall (http://m0n0.ch/wall)
-
+
Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -50,19 +50,19 @@ function dump_clog_vpn($logfile, $tail) {
$logarr = "";
exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
-
+
foreach ($logarr as $logent) {
$logent = preg_split("/\s+/", $logent, 6);
$llent = explode(",", $logent[5]);
-
+
echo "<tr>\n";
echo "<td class=\"listlr\" nowrap>" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "</td>\n";
-
+
if ($llent[0] == "login")
echo "<td class=\"listr\"><img src=\"/themes/{$g['theme']}/images/icons/icon_in.gif\" width=\"11\" height=\"11\" title=\"login\"></td>\n";
else
echo "<td class=\"listr\"><img src=\"/themes/{$g['theme']}/images/icons/icon_out.gif\" width=\"11\" height=\"11\" title=\"logout\"></td>\n";
-
+
echo "<td class=\"listr\">" . htmlspecialchars($llent[3]) . "</td>\n";
echo "<td class=\"listr\">" . htmlspecialchars($llent[2]) . "&nbsp;</td>\n";
echo "</tr>\n";
@@ -87,6 +87,7 @@ include("head.inc");
$tab_array[] = array("PPTP VPN", true, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_slbd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
$tab_array[] = array("Settings", false, "diag_logs_settings.php");
display_top_tabs($tab_array);
?>
@@ -94,7 +95,7 @@ include("head.inc");
<tr>
<td class="tabcont">
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
- <td colspan="4" class="listtopic">
+ <td colspan="4" class="listtopic">
Last <?=$nentries;?> PPTP VPN log entries</td>
</tr>
<tr>
OpenPOWER on IntegriCloud