Click to See Complete Forum and Search --> : howto send a mail when clamav finds a virus ?


ccc
05-21-2008, 05:24 AM
hi

I've installed clamav, clamav-daemon and clamav-freshclam on my debian etch stable and I scan all directories using:
05 4 * * * clamscan -r / >/dev/null 2>&1
howto configure to send a mail when clamav finds a virus ?

greetings
ccc

ph34r
05-22-2008, 10:37 AM
I wouldn't send the output to /dev/null, but instead to some log file somewhere. Then parse the log file for any virus found alerts (grep), and then if there are alerts, send some mail (using the mail command or perhaps mailm or other utility). Then when it is all done, you can delete the log file, or gzip it and rename it with a date stamp, etc.

Might want to look at the bash scripting cheat sheet, the bash scripting howto/guide on tldp.org, etc.

ccc
05-22-2008, 11:51 AM
thanks a lot,
but has someone already such a script bash or perl and can post it ?

ph34r
05-22-2008, 02:43 PM
Can you post the output that clamav would give when it finds a virus, and the output given when no virus is found (scanned a clean file)?