|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/logwatch/scripts/services/ |
Upload File : |
##################################################################
#
# clamav script ver. 0.85.1 for Logwatch.
#
# Written by S. Schimkat <www.schimkat.dk>.
#
# Find latest version here: www.schimkat.dk/clamav
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
##################################################################
$Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'};
my $IgnoreUnmatched = $ENV{'clamav_ignoreunmatched'} || 0;
while (defined($ThisLine = <STDIN>)) {
if (
( $ThisLine =~ /^clamav-milter (startup|shutdown) succeeded$/ ) or
( $ThisLine =~ /^Quarantined infected mail as/ ) or
( $ThisLine =~ /^File quarantined as/ ) or
( $ThisLine =~ /^ClamAv: mi_stop/ )) {
# We do not care about these.
} elsif (($ThisLine =~ /clean message from/)) {
$CleanMessage++;
# the following elsif block is from an old version of clamav-milter, and
# is to be removed in the near future
} elsif (
(($Virus) = ($ThisLine =~ /stream: (.*?) FOUND/i )) or
(($Virus) = ($ThisLine =~ /^.+?msg\.\w+?: (.*?) FOUND/i )) or
(($Virus) = ($ThisLine =~ /stream: (.*?) Intercepted virus from/i )) or
(($Virus) = ($ThisLine =~ /^[a-zA-Z0-9]+: [^ ]*: (.*?) Intercepted virus from/i ))
) {
$VirusList{$Virus}++;
} elsif (($Virus) = ($ThisLine =~ /.*: (.+?) Intercepted virus/i )) {
$VirusList{$Virus}++;
} elsif (($ChildLimit) = ($ThisLine =~ /hit max-children limit \((\d+ >= \d+)\): waiting for some to exit/)) {
$MaxChildrenLimit{$ChildLimit}++;
} elsif (($ThisLine =~ /^Stopping/)) {
$DaemonStop++;
} elsif (($ThisLine =~ /^Starting/)) {
$DaemonStart++;
} else {
push @OtherList,$ThisLine;
}
}
if (($DaemonStop) and ($Detail >= 5)) {
print "\nDaemon stopped: " . $DaemonStop . " Time(s)\n";
}
if (($DaemonStart) and ($Detail >= 5)) {
print "\nDaemon started: " . $DaemonStart . " Time(s)\n";
}
if (keys %MaxChildrenLimit) {
print "\nHit max-hildren limit:\n";
foreach $Limit (sort {$a cmp $b} keys %MaxChildrenLimit) {
print ' Limit ' . $Limit . ' children(s) exceeded ' . $MaxChildrenLimit{$Limit} . " Time(s)\n"
}
}
if ($CleanMessage) {
print "\nClean messages: " . $CleanMessage . " Message(s)\n";
}
if (keys %VirusList) {
print "\nInfected messages:\n";
foreach $Virus (sort {$a cmp $b} keys %VirusList) {
print ' ' . $Virus . ": ". $VirusList{$Virus} . " Message(s)\n";
}
}
if (($#OtherList >= 0) and (not $IgnoreUnmatched)){
print "\n**Unmatched Entries**\n";
print @OtherList;
}
exit(0);
# vi: shiftwidth=3 tabstop=3 syntax=perl et