Clamav-daemon service down

I have many VPS some have 2gb memory and face clam av down, so I use this script every 5 min

sstat=$(pidof $serv | wc -l )
if [ $sstat -gt 0 ]
echo “$servname is running fine!!!”
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]

I hope to help someone

where you add that script ?

You can save the file in root folder and add cron job hourly
use etc cron not Hestiap cron

Just create the script
nano /home/michael/
chmod +x /home/michael/
Add it to cron
crontab -e or via panel

Hestia overwrites crontab file on rebuild so via panel is saver…

1 Like

Good to know.

I use /etc/crontab in all server and any control panel I use

Thank you for your answer …

I get mail error

clamav-daemon is down/dead” line 11: service: command not found line 12: mail: command not found

Do you install Clamav ?

Only in servers with email since it doesn’t scan for php scripts.