diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-10-07 00:44:02 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-10-07 00:44:02 +0000 |
commit | fa626e70d014bf172f2aa541c6844432be830b0b (patch) | |
tree | 95fb0bb11c743ef6ce5702e43829f890dd95e5f5 /usr | |
parent | 7fdcfdd3e3d86f42133983d458c3bfc3318867f2 (diff) | |
download | pfsense-fa626e70d014bf172f2aa541c6844432be830b0b.zip pfsense-fa626e70d014bf172f2aa541c6844432be830b0b.tar.gz |
* Fix status -> slbd
* Simplify dump_clog() and return_clog() to where a preschooler can read
* Fix main diagnostics logs after the above fallout
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/diag_logs.php | 2 | ||||
-rwxr-xr-x | usr/local/www/guiconfig.inc | 56 |
2 files changed, 15 insertions, 43 deletions
diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php index 07238d8..bcb8605 100755 --- a/usr/local/www/diag_logs.php +++ b/usr/local/www/diag_logs.php @@ -79,7 +79,7 @@ include("head.inc"); <tr> <td colspan="2" class="listtopic">Last <?=$nentries;?> system log entries</td> </tr> - <?php dump_clog($system_logfile, $nentries, true, array("racoon","ntpd"), array("pppoe")); ?> + <?php dump_clog($system_logfile, $nentries, true, array(), array("racoon", "ntpd", "pppoe")); ?> <tr> <td> <br> diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 28d4438..b80e8b5 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -563,18 +563,12 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert $sor = isset($config['syslog']['reverse']) ? "-r" : ""; $logarr = ""; $grepline = " "; - if(is_array($grepfor)) { - $i = 0; - foreach($grepfor as $agrep) { - $regexp = $agrep; - if($grepinvert[$i]) { - $grepline .= " | grep \"$regexp\""; - } else { - $grepline .= " | grep -v \"$regexp\""; - } - $i++; - } - } + if(is_array($grepfor)) + foreach($grepfor as $agrep) + $grepline .= " | grep \"$agrep\""; + if(is_array($grepinvert)) + foreach($grepinvert as $agrep) + $grepline .= " | grep -v \"$agrep\""; exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr); echo "<!-- /usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail} -->"; foreach ($logarr as $logent) { @@ -597,37 +591,15 @@ function return_clog($logfile, $tail, $grepfor = "", $grepinvert = "", $grepreve $sor = isset($grepreverse) ? "-r" : ""; $logarr = ""; $grepline = " "; - if(is_array($grepfor)) { - $i = 0; - foreach($grepfor as $agrep) { - $regexp = $agrep; - if($grepinvert[$i]) { - $grepline .= " | grep \"$regexp\""; - } else { - $grepline .= " | grep -v \"$regexp\""; - } - $i++; - } - } + if(is_array($grepfor)) + foreach($grepfor as $agrep) + $grepline .= " | grep \"$agrep\""; + if(is_array($grepinvert)) + foreach($grepinvert as $agrep) + $grepline .= " | grep -v \"$agrep\""; + echo "<!-- /usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail} -->"; exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr); - if(is_array($grepfor)) { - $i = 0; - foreach($grepfor as $agrep) { - $regexp = "/" . $agrep . "/i"; - if($grepinvert[$i]) { - $logarr = preg_grep($regexp, $logarr, PREG_GREP_INVERT); - } else { - $logarr = preg_grep($regexp, $logarr); - } - $i++; - } - } - $i = 0; - foreach ($logarr as $logent) { - $logarray[$i] = "$logent"; - $i++; - } - return($logarray); + return($logarr); } /* Check if variable has changed, update and log if it has |