From ebb4954b9820cd49e3926431ae373f5b1d9776bc Mon Sep 17 00:00:00 2001 From: Dennis Neuhaeuser Date: Sat, 11 Apr 2015 22:01:47 +0200 Subject: fetch virus log addded code to fetch entries from virus log and push to "realtime" table --- config/squid3/34/squid_monitor_data.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'config/squid3') 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 "\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 "\n"; + echo "{$logline[0]}\n"; + echo "{$logline[1]}\n"; + echo "{$logline[2]}\n"; + echo "{$logline[3]}\n"; + echo "{$logline[4]}\n"; + echo "{$logline[5]}\n"; + echo "\n"; + } + break; } } -- cgit v1.2.3