Install Monit:
sudo -i
amazon-linux-extras install epel
yum -y install monit
Config monit:
vim /etc/monitrc
set daemon
# set logfile /var/log/monit.log check process squid with pidfile /run/squid.pid
start program = "/usr/sbin/squid -f /etc/squid/squid.conf"
# if failed port protocol http then restart
set daemon 1
# set logfile /var/log/monit.log
Disable and stop squid then enable monit
systemctl stop squid
systemctl disable squid
systemctl enable monit
systemctl start monit
View status
monit summary
monit status