diff options
author | Dennis Neuhaeuser <dn@arbor.de> | 2015-04-11 22:01:47 +0200 |
---|---|---|
committer | Dennis Neuhaeuser <dn@arbor.de> | 2015-04-11 22:01:47 +0200 |
commit | ebb4954b9820cd49e3926431ae373f5b1d9776bc (patch) | |
tree | 3aa9edc8ba69c97a3e1b89dff9bbb09f61395e9f /config/squid3/34 | |
parent | a2721d5da1434007c433225f86774948d03ec548 (diff) | |
download | pfsense-packages-ebb4954b9820cd49e3926431ae373f5b1d9776bc.tar.gz pfsense-packages-ebb4954b9820cd49e3926431ae373f5b1d9776bc.tar.bz2 pfsense-packages-ebb4954b9820cd49e3926431ae373f5b1d9776bc.zip |
fetch virus log
addded code to fetch entries from virus log and push to "realtime" table
Diffstat (limited to 'config/squid3/34')
-rwxr-xr-x | config/squid3/34/squid_monitor_data.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/config/squid3/34/squid_monitor_data.php b/config/squid3/34/squid_monitor_data.php index 6223330e..9010f0a2 100755 --- a/config/squid3/34/squid_monitor_data.php +++ b/config/squid3/34/squid_monitor_data.php @@ -113,6 +113,34 @@ if ($_POST) { echo "</tr>\n"; } break; + case 'clamav'; + // Define log file + $log='/var/log/c-icap/virus.log'; + //show table headers + show_tds(array("Date-Time","Message","Virus","URL","Host","User")); + //fetch lines + $logarr=fetch_log($log); + foreach ($logarr as $logent) { + // Split line by space delimiter + $logline = preg_split("/\|/", $logent); + + // Apply time format + $logline[0] = date("d.m.Y H:i:s", strtotime($logline[0])); + + // Word wrap the URL + $logline[3] = htmlentities($logline[3]); + $logline[3] = html_autowrap($logline[3]); + + echo "<tr>\n"; + echo "<td class=\"listlr\" nowrap>{$logline[0]}</td>\n"; + echo "<td class=\"listr\" nowrap>{$logline[1]}</td>\n"; + echo "<td class=\"listr\">{$logline[2]}</td>\n"; + echo "<td class=\"listr\">{$logline[3]}</td>\n"; + echo "<td class=\"listr\">{$logline[4]}</td>\n"; + echo "<td class=\"listr\">{$logline[5]}</td>\n"; + echo "</tr>\n"; + } + break; } } |