Hello,
I have many VPS some have 2gb memory and face clam av down, so I use this script every 5 min
#!/bin/bash #Waelhttps://www.wael.name
serv=clamd
servname=clamav-daemon
sstat=$(pidof $serv | wc -l )
if [ $sstat -gt 0 ]
then
echo “$servname is running fine!!!”
else
echo “$servname is down/dead”
service $servname start
echo “$servname service is UP now!!!” | mail -s “$servname service is DOWN and restarted now On $(hostname)” [email protected]
fi