Question

Auto Restart Services if Failed

Posted February 13, 2014 6.1k views
hi my system is centos 6.5 i need to know if there's script to automatic restart the services if failed and it announce to admin by using email. thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers
Hi Agus,

You can try this for the automatic restart of services:
https://www.digitalocean.com/community/articles/how-to-use-a-simple-bash-script-to-restart-server-programs

To do email check this one if it helps:
https://www.digitalocean.com/community/articles/how-to-send-e-mail-alerts-on-a-centos-vps-for-system-monitoring
by O.S Tezer
In this article, we learn how to simply send e-mail alerts on a VPS and talk about various triggers that can be set to establish better overall security and to maintain a smooth running system. We go through the basics of e-mail, the necessary applications, along with examples of various e-mail alert triggers.
Have you looked at Monit?
Submit an Answer