Configure Monit on AWS CentOS7 to guard Squid proxy

Install Monit:
sudo -i
amazon-linux-extras install epel
yum -y install monit

Config monit:

vim /etc/monitrc

set daemon 1
# 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 808 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

原文地址:https://www.cnblogs.com/lionetchen/p/10488933.html