Koozali.org: home of the SME Server

[SOLVED][ClamAV] suppress checking ibay?

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SOLVED][ClamAV] suppress checking ibay?
« Reply #15 on: October 06, 2006, 03:59:01 PM »
Look in /sbin/e-smith/smeserver-clamscan

Is there a difference between
Code: [Select]
my @exclude = split /,/, ($db->get_prop("clamav", "FilesystemScanExclude") ||
 "/proc,/sys,/usr/share/doc");

and
Code: [Select]
my @exclude = split /,/, ($db->get_prop("clamav", "FilesystemScanExclude") || "/proc,/sys,/usr/share/doc");
Regards,
William

IF I give advise.. It's only if it was me....

Offline piran

  • ****
  • 502
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #16 on: October 06, 2006, 04:03:24 PM »
Code: [Select]

#!/usr/bin/perl -w
#----------------------------------------------------------------------
# Clam Antivirus virus scanner filesystem scanning.
#
# copyright (C) 2004 Shad L. Lords <slords@mail.com>
# Copyright (C) 2005 Gordon Rowell <gordonr@gormand.com.au>
#
# 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 or more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#----------------------------------------------------------------------

use strict;
use esmith::ConfigDB;

my $db = esmith::ConfigDB->open_ro or die "Couldn't open ConfigDB";

my $filesystems = $db->get_prop("clamav", "FilesystemScanFilesystems") || '/';

my $MailReport = $db->get_prop("clamav", "FilesystemScanReportTo") || 'admin';

my $clamscan_opts = " --recursive --infected --stdout" .
                    " --log /var/log/clamd/clamscan.log";

my $quarantine_dir = $db->get_prop("clamav", "QuarantineDirectory") ||
                "/var/spool/clamav/quarantine";

my @exclude = split /,/, ($db->get_prop("clamav", "FilesystemScanExclude") ||
                          "/proc,/sys,/usr/share/doc");

push @exclude, $quarantine_dir;

$clamscan_opts .= " --exclude $_" for (@exclude);

$clamscan_opts .= " --move=$quarantine_dir"
        if ($db->get_prop("clamav", "Quarantine") || "disabled") eq "enabled";

open CLAMSCAN, "-|", "nice /usr/bin/clamscan $clamscan_opts $filesystems 2>\&1";

my @report = <CLAMSCAN>;
close CLAMSCAN;

my $hostname = $db->get_value("SystemName") . "." .
        $db->get_value("DomainName");

my $date = localtime;

open MAIL, "| /bin/mail " .
        "-s \"[$hostname] Clam Antivirus Scan Results - $date\" $MailReport";

print MAIL @report;
close MAIL;



Offline Gaston94

  • ****
  • 184
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #17 on: October 06, 2006, 04:09:09 PM »
Quote from: "william_syd"
I could be wrong.
I only found two places where exclude paths for clamav.
this clamuko one
and the command line one :
 clamscan -r /home/e-smith/files/users --exclude /home/e-smith/files/ibays

G.

Offline piran

  • ****
  • 502
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #18 on: October 06, 2006, 04:19:07 PM »
Tried the command line option.
I saw ibay addresses appearing very briefly with : Excluded at the end.
That manually invoked test run finished in realtime (as opposed to 5days).
Code: [Select]

[root@teri /]#  clamscan -r /home --exclude /home/e-smith/files/ibays
----------- SCAN SUMMARY -----------
Known viruses: 71520
Engine version: 0.88.4
Scanned directories: 16020
Scanned files: 2032
Infected files: 0
Data scanned: 30.62 MB
Time: 77.804 sec (1 m 17 s)
[root@teri /]#


How to fix the automatic run at midnight...

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SOLVED][ClamAV] suppress checking ibay?
« Reply #19 on: October 06, 2006, 04:22:19 PM »
Quote from: "Gaston94"
Quote from: "william_syd"
I could be wrong.
I only found two places where exclude paths for clamav.
this clamuko one
and the command line one :
 clamscan -r /home/e-smith/files/users --exclude /home/e-smith/files/ibays

G.


I think the command line one is the one that gets used.

Open two console terminals. In one run htop and in the other run /sbin/e-smith/smeserver-clamscan .

Clamscan should now be at the top of the list and you can see what command line parameters were used.
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SOLVED][ClamAV] suppress checking ibay?
« Reply #20 on: October 06, 2006, 04:27:18 PM »
Quote from: "piran"
Not solved after all;~/

Just missed the midnight check so I implemented a ClamAV run manually.
Code: [Select]
[root@teri /]# clamscan -r /home --quiet


Is the manual implementation of ClamAV different from what runs normally?



Yes.

Try
Code: [Select]
/sbin/e-smith/smeserver-clamscan
Regards,
William

IF I give advise.. It's only if it was me....

Offline piran

  • ****
  • 502
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #21 on: October 06, 2006, 04:28:44 PM »
The htop panel merely reflected whichever command line I used,
or do you mean for me to watch at midnight?

Offline Gaston94

  • ****
  • 184
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #22 on: October 06, 2006, 04:31:28 PM »
Will,
Quote from: "william_syd"
Is there a difference between
Code: [Select]
my @exclude = split /,/, ($db->get_prop("clamav", "FilesystemScanExclude") ||
 "/proc,/sys,/usr/share/doc");

and
Code: [Select]
my @exclude = split /,/, ($db->get_prop("clamav", "FilesystemScanExclude") || "/proc,/sys,/usr/share/doc");

No

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SOLVED][ClamAV] suppress checking ibay?
« Reply #23 on: October 06, 2006, 04:40:17 PM »
Quote from: "Gaston94"
Will,
Quote from: "william_syd"
Is there a difference between
Code: [Select]
my @exclude = split /,/, ($db->get_prop("clamav", "FilesystemScanExclude") ||
 "/proc,/sys,/usr/share/doc");

and
Code: [Select]
my @exclude = split /,/, ($db->get_prop("clamav", "FilesystemScanExclude") || "/proc,/sys,/usr/share/doc");

No


Thats funny.  :D
Regards,
William

IF I give advise.. It's only if it was me....

Offline piran

  • ****
  • 502
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #24 on: October 06, 2006, 04:41:21 PM »
@will Missed reading your earlier post...
Code: [Select]
[root@teri /]# /sbin/e-smith/smeserver-clamscan
...rather than just looking at the contents tried invoking it.
Had to horizontally scroll htop to read the whole line.
VERY LONG (too long?) and shows all the --excludes separately.
Is this the problem because the very last one looks truncated?
(might be htop or my PuTTY settings)

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SOLVED][ClamAV] suppress checking ibay?
« Reply #25 on: October 06, 2006, 04:41:58 PM »
Quote from: "piran"
The htop panel merely reflected whichever command line I used,
or do you mean for me to watch at midnight?


Use
Code: [Select]
/sbin/e-smith/smeserver-clamscan
by itself and htop will show your --exclude's as per the database.
Regards,
William

IF I give advise.. It's only if it was me....

Offline Gaston94

  • ****
  • 184
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #26 on: October 06, 2006, 04:42:02 PM »
Piran,
Quote from: "piran"
Not solved after all;~/
Code: [Select]
[root@teri /]# clamscan -r /home --quiet

Is the manual implementation of ClamAV different from what runs normally?

Yes,
the sme clamscan is finally  issuing the following command :
Code: [Select]

nice /usr/bin/clamscan  --recursive --infected --stdout \
--log /var/log/clamd/clamscan.log --exclude /proc \
 --exclude /sys --exclude /usr/share --exclude /var \
--exclude /var/spool/clamav/quarantine
--exclude /home/e-smith/files/ibays \
/

(with the extra exclusion from the db setprop we talked about)

G.
PS so my first post wath the correct solution, no ?

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SOLVED][ClamAV] suppress checking ibay?
« Reply #27 on: October 06, 2006, 04:44:00 PM »
Quote from: "Gaston94"
Piran,
Quote from: "piran"
Not solved after all;~/
Code: [Select]
[root@teri /]# clamscan -r /home --quiet

Is the manual implementation of ClamAV different from what runs normally?

Yes,
the sme clamscan is finally  issuing the following command :
Code: [Select]

nice /usr/bin/clamscan  --recursive --infected --stdout \
--log /var/log/clamd/clamscan.log --exclude /proc \
 --exclude /sys --exclude /usr/share --exclude /var \
--exclude /var/spool/clamav/quarantine
--exclude /home/e-smith/files/ibays \
/

(with the extra exclusion from the db setprop we talked about)

G.
PS so my first post wath the correct solution, no ?


Yes.

Piran's use of clamscan sent me on a Goose chase..  :oops:

edit: Plus I only grep'ed /etc for the db property.
Regards,
William

IF I give advise.. It's only if it was me....

Offline piran

  • ****
  • 502
  • +0/-0
[SOLVED][ClamAV] suppress checking ibay?
« Reply #28 on: October 06, 2006, 04:50:22 PM »
Code: [Select]
/sbin/e-smith/smeserver-clamscan
...is that a good simulation of what occurs at midnight automatically?

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
[SOLVED][ClamAV] suppress checking ibay?
« Reply #29 on: October 06, 2006, 05:10:02 PM »
From man clamscan,
Code: [Select]
--exclude=PATT, --exclude-dir=PATT
              Don't scan file/directory names containing PATT. It may be used multiple times.


Is there a difference between --exclude=PATT and --exclude-dir=PATT ?

Interesting..
http://www.webservertalk.com/archive389-2006-2-1386908.html
Regards,
William

IF I give advise.. It's only if it was me....