[clamav-users] Is there an option to see the scan duration in the log?

G.W. Haywood clamav at jubileegroup.co.uk
Thu Apr 23 09:07:06 UTC 2020


Hi there,

On Thu, 23 Apr 2020, Kreidenberg, Maximilian, 22D wrote:

> we are using clamav in our production environment and we need to
> find out how long a scan takes.  Is there an option to display the
> duration of a scan in the logfile? I already searched for it in the
> documentation and manpage but I found nothing.

It depends very much on how you're scanning things.  If you're running
a scan from the command line or a script, you could simply send the
output to the log instead of viewing it on the terminal, for example

clamdscan /path/to/directory_to_be_scanned/ | logger -t 'ClamAV'

If you're using a milter for example you may need to be a little more
creative.  My own milter logs data volumes and scan times (it calls
functions in a high resolution time library), and calculates and logs
scan rates.  For example:

Apr 23 09:13:50 mail6 xm[19164]: 03N8DU43017692: xm_scan(9473): [167.89.86.166], Attempting to send [13890] bytes to ClamAV daemon from entire_message...
Apr 23 09:13:50 mail6 xm[19164]: 03N8DU43017692: xm_scan(9473): [167.89.86.166], Sent [13890] bytes to clamd...
Apr 23 09:13:51 mail6 xm[19164]: 03N8DU43017692: xm_scan(9473): [167.89.86.166], clamd on IP [192.168.44.7] port [3313] replied [stream: OK]
Apr 23 09:13:51 mail6 xm[19164]: 03N8DU43017692: xm_scan(9473): [167.89.86.166], clamd on IP [192.168.44.7] port [3313] scanned [13890] bytes in [1.177] seconds (11.797 kbytes/sec), nothing found in entire_message

This example is running on a Raspberry Pi 4B, and the milter warns me
if scan rates fall below some more or less arbitrary limit.  I'm not
sure now why I did that. :)

How are you scanning things?

-- 

73,
Ged.



More information about the clamav-users mailing list