mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Switch back to clog but leave option to run fifolog.
This commit is contained in:
parent
b24358d1ac
commit
568f30c2f8
@ -56,16 +56,16 @@ if (!$nentries)
|
||||
$nentries = 50;
|
||||
|
||||
if ($_POST['clear']) {
|
||||
exec("/usr/bin/killall syslogd");
|
||||
if(isset($config['system']['disablesyslogclog'])) {
|
||||
unlink("/var/log/filter.log");
|
||||
touch("/var/log/filter.log");
|
||||
} else {
|
||||
// exec("killall syslogd");
|
||||
// sleep(1);
|
||||
// if(file_exists("{$filter_logfile}"))
|
||||
// unlink("{$filter_logfile}");
|
||||
exec("/usr/sbin/fifolog_create -s 511488 {$filter_logfile}");
|
||||
exec("/usr/bin/killall -HUP syslogd");
|
||||
if(isset($config['system']['usefifolog'])) {
|
||||
exec("/usr/sbin/fifolog_create -s 511488 {$filter_logfile}");
|
||||
} else {
|
||||
exec("/usr/sbin/clog -i -s 262144 {$filter_logfile}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,10 @@ function conv_clog($logfile, $tail = 50) {
|
||||
|
||||
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
|
||||
|
||||
exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n 500", $logarr);
|
||||
if(isset($config['system']['usefifolog']))
|
||||
exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n 500", $logarr);
|
||||
else
|
||||
exec("/usr/sbin/clog {$logfile} | grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n 500", $logarr);
|
||||
|
||||
$filterlog = array();
|
||||
|
||||
|
||||
@ -48,17 +48,18 @@ if (!$nentries)
|
||||
handle_ajax();
|
||||
|
||||
if ($_POST['clear']) {
|
||||
exec("/usr/bin/killall syslogd");
|
||||
if(isset($config['system']['disablesyslogclog'])) {
|
||||
unlink("/var/log/filter.log");
|
||||
touch("/var/log/filter.log");
|
||||
} else {
|
||||
// exec("killall syslogd");
|
||||
// sleep(1);
|
||||
// if(file_exists("{$filter_logfile}")
|
||||
// unlink("{$filter_logfile}");
|
||||
exec("/usr/sbin/fifolog_create -s 511488 {$filter_logfile}");
|
||||
exec("/usr/bin/killall -HUP syslogd");
|
||||
} else {
|
||||
if(isset($config['system']['usefifolog'])) {
|
||||
exec("/usr/sbin/fifolog_create -s 511488 {$filter_logfile}");
|
||||
} else {
|
||||
exec("/usr/sbin/clog -i -s 262144 {$filter_logfile}");
|
||||
}
|
||||
}
|
||||
system_syslogd_start();
|
||||
}
|
||||
|
||||
/* format filter logs */
|
||||
@ -74,7 +75,10 @@ function conv_clog_filter($logfile, $tail = 50) {
|
||||
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
|
||||
|
||||
$logarr = "";
|
||||
exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
|
||||
if(isset($config['system']['usefifolog']))
|
||||
exec("/usr/sbin/fifolog_reader {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
|
||||
else
|
||||
exec("/usr/sbin/clog {$logfile} | grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr);
|
||||
|
||||
$filterlog = array();
|
||||
|
||||
@ -87,7 +91,6 @@ function conv_clog_filter($logfile, $tail = 50) {
|
||||
|
||||
$log_split = "";
|
||||
|
||||
|
||||
preg_match("/(\b(?:\d{1,3}\.){3}\d{1,3}(\.\w+)?)\s.*\s(\b(?:\d{1,3}\.){3}\d{1,3}(\.\w+)?)/", $logent, $log_split);
|
||||
|
||||
$flent['src'] = convert_port_period_to_colon($log_split[1]);
|
||||
|
||||
@ -45,16 +45,15 @@ if (!$nentries)
|
||||
$nentries = 50;
|
||||
|
||||
if ($_POST['clear']) {
|
||||
exec("/usr/bin/killall syslogd");
|
||||
if(isset($config['system']['disablesyslogclog'])) {
|
||||
unlink("/var/log/vpn.log");
|
||||
touch("/var/log/vpn.log");
|
||||
} else {
|
||||
// exec("killall syslogd");
|
||||
// sleep(1);
|
||||
// if(file_exists("/var/log/vpn.log"))
|
||||
// unlink("/var/log/vpn.log");
|
||||
exec("/usr/sbin/fifolog_create -s 50688 /var/log/vpn.log");
|
||||
exec("/usr/bin/killall -HUP syslogd");
|
||||
if(isset($config['system']['usefifolog']))
|
||||
exec("/usr/sbin/fifolog_create -s 50688 /var/log/vpn.log");
|
||||
else
|
||||
exec("/usr/sbin/clog -i -s 262144 /var/log/vpn.log");
|
||||
}
|
||||
/* redirect to avoid reposting form data on refresh */
|
||||
header("Location: diag_logs_vpn.php");
|
||||
@ -67,7 +66,11 @@ function dump_clog_vpn($logfile, $tail) {
|
||||
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
|
||||
|
||||
$logarr = "";
|
||||
exec("/usr/sbin/fifolog_reader " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
|
||||
|
||||
if(isset($config['system']['usefifolog']))
|
||||
exec("/usr/sbin/fifolog_reader " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
|
||||
else
|
||||
exec("/usr/sbin/clog " . $logfile . " | grep -v \"CLOG\" | grep -v \"\033\" | tail {$sor} -n " . $tail, $logarr);
|
||||
|
||||
foreach ($logarr as $logent) {
|
||||
$logent = preg_split("/\s+/", $logent, 6);
|
||||
|
||||
@ -172,9 +172,14 @@ defCmdT("racoon.conf","cat /var/etc/racoon.conf");
|
||||
defCmdT("SPD","/sbin/setkey -DP");
|
||||
defCmdT("SAD","/sbin/setkey -D");
|
||||
|
||||
defCmdT("last 200 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200");
|
||||
defCmdT("last 50 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50");
|
||||
|
||||
if(isset($config['system']['usefifolog'])) {
|
||||
defCmdT("last 200 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200");
|
||||
defCmdT("last 50 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50");
|
||||
} else {
|
||||
defCmdT("last 200 system log entries","/usr/sbin/clog /var/log/system.log 2>&1 | tail -n 200");
|
||||
defCmdT("last 50 filter log entries","/usr/sbin/clog /var/log/filter.log 2>&1 | tail -n 50");
|
||||
}
|
||||
|
||||
defCmd("ls /conf");
|
||||
defCmd("ls /var/run");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user