diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-06-26 14:57:14 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-06-26 14:57:14 +0000 |
commit | 3bbee5ed6241a9e80b1d94154f305cbba0b639a5 (patch) | |
tree | 5849dd5fd4ef54e7c9341e8ccc40c6a5bbbeea9c /usr | |
parent | 3a7f8376f613f312448a6ab661662b9c3d8e6cc3 (diff) | |
download | pfsense-3bbee5ed6241a9e80b1d94154f305cbba0b639a5.zip pfsense-3bbee5ed6241a9e80b1d94154f305cbba0b639a5.tar.gz |
MFC 12656
Required changes for status_slbd_pool.php
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/guiconfig.inc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 24656d5..1d59eb0 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -615,6 +615,32 @@ function return_clog($logfile, $tail, $grepfor = "", $grepinvert = "", $grepreve return($logarray); } +function return_clog($logfile, $tail, $grepfor = "", $grepinvert = "") { + global $g, $config; + $sor = isset($config['syslog']['reverse']) ? "-r" : ""; + $logarr = ""; + exec("/usr/sbin/clog {$logfile} | 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); +} + /* Check if variable has changed, update and log if it has * returns true if var changed * varname = variable name in plain text |