MonitÀ» ÀÌ¿ëÇÑ demon ÀÚµ¿ Àç½ÇÇà (CentOS7)
https://www.ehostidc.co.kr/hosting/domestic.php (554)https://www.ehostidc.co.kr/colocation/colocation.php (533)
1) EPEL repository 활성화 |
root@localhost:[~]: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
2) monit 설치 |
root@localhost:[~]: yum install monit |
3) conf 파1068; 수1221; |
root@localhost:[~]: vi /etc/monitrc 157 set httpd port 2812 and // web port 158 160; 160; use address 192.168.126.30160; # only accept connection from localhost (drop if you use M/Monit) 160;// /196;컬서버IP 159 160; 160; allow 192.168.126.0/24 160; 160; 160; 160;# allow localhost to connect to the server and // 1217;근IP 160 160; 160; allow localhost 161 160; 160; allow admin:monit 160; 160;160; # require user 'admin' with password 'monit' // 웹 1217;근계1221; |
4) firewalld 1221;책 추가 |
root@localhost:[~]: firewall-cmd --permanent --zone=public --add-port=2812/tcp root@localhost:[~]: firewall-cmd --reload root@localhost:[~]: netstat -lnp |
5) 사용1088; 1648;1221; 모니터링 설1221; (ex: ssh) |
root@localhost:[~]: vi /etc/monit.d/sshd check process ssh with pidfile /var/run/sshd.pid // check process [서비스명] with pidfile “[서비스PID 위치]̶1; start program = "/usr/bin/systemctl start sshd" // R16;서비스 시1089; 명/161;Ǻ12;̶1; stop program = "/usr/bin/systemctl stop sshd"160;// 서비스 1473;1648; 명/161;Ǻ12;̶1; if failed host 127.0.0.1 port 22 then restart // /196;컬서버1032; 22번 포트가 1473;1648; 시 1116;시1089; monit R11;t 명/161;Ǻ12;/196; 문법설1221; 1060;상 유무 확1064; 가능 설1221; 완료 후 systemctl restart monit |
6) Daemon 체크 간ᅄ1; |
root@localhost:[~]: vi /etc/monitrc // 체크 간ᅄ1; 30초 |
7) 테스트 |
root@localhost:[~]: cat /var/log/monit.log |
8) web 1217;속 |
9 1452;요 명/161;Ǻ12; |