Beta release 4.61.1

Chris Conn cconn at abacom.com
Tue Jun 5 14:15:15 IST 2007


> It would be possible to add an option to restart the daemon if a problem was
> encountered however I leave that up to Julian as it would require running
> the hosts init script and I don't know if that is something he would want to
> do. However if clamd has a problem your logs will note this and you could
> certainly set up a script to run in cron to look for MailScanner clamd
> errors and notify you. I personally monitor all my important daemons for
> trouble and I have a script that PINGS clamd that runs from cron. I really
> haven't had problems with clamd for at least a year and I never restart it.
> I only have redhat/centos/fedora based distros though.
> 

I have a cronjob that runs clamdscan every minute scanning the eicar.com 
virus.  If it does not report a FOUND, my monitoring system gets a page. 
The script also immediately tries a restart of clamd.




#!/bin/bash


if ! (/usr/bin/test -e /tmp/clamstatus)
then
    echo 1 >/tmp/clamstatus
fi

if ! (/usr/bin/test -e /tmp/clamstatus2)
then
    echo 1 >/tmp/clamstatus2
fi

export PATH=$PATH:/usr/sbin/
export THEDATE=`/bin/date`

/usr/bin/clamdscan --no-summary /root/scripts/eicar.com >&/tmp/test
if cat /tmp/test|grep -v FOUND
then
    if cat /tmp/clamstatus2|grep 1
    then
       echo 0 >/tmp/clamstatus2
       --DO SOMETHING HERE-- (ours calls sendpage)
       /etc/rc.d/init.d/clamd restart
    fi
else
    if cat /tmp/clamstatus2|grep 0
    then
       echo 1 >/tmp/clamstatus2
       --PAGE RECOVERY--
    fi
fi





I snipped out the paging stuff, modify it at will.

Chris


More information about the MailScanner mailing list