ClamAV is a great free anti-virus but the only problem is it’s a memory hog. Virtualmin recommends 2 GB of RAM but we’ve seen it fail on systems with up to 6 GB of RAM and 12 GB of swap space.
Conclusion?
ClamAV will give you grief because it will periodically stop working.
Fortunately the Webmin UI already has a process monitor that works to restart it automatically. You could also try Monit, but Monit is more complicated.
To monitor ClamAV:
Webmin / Tools / System and Service Status / Add monitor of type
“Check Process”
Give it a suitable name. I like short and sweet, so mine is just:
“Check Process clamav-daemon”
Add a notification method email, and put your alerts email address. You can of course skip this step but as a responsible server administrator you shouldn’t.
Next, command to start the service when it goes down:
service clamav-daemon start
Finally the most tricky part is the “Command to check for” and this has to be
clamd
Don’t ask my why the service and the command are different.
According to this forum post you can do the same for Spamassassin but in my experience putting in “spamassassin” for “Command to check for” doesn’t work.
See also
Reference
- https://forum.virtualmin.com/t/system-and-server-status-check-process-clamav-and-spamassassin/105933
We also provide a link to the offical Webmin documentation for this tool, but be warned, it severely outdated: