-
Notifications
You must be signed in to change notification settings - Fork 2
/
cai dat monit.txt
35 lines (35 loc) · 1.63 KB
/
cai dat monit.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cai dat monit:
wget http://pkgs.repoforge.org/monit/monit-5.4-1.el5.rf.i386.rpm
rpm -ivh monit-5.4-1.el5.rf.i386.rpm
file config : /etc/monit.conf
cau hinh monit de monitor cac service tren server
1. service httpd co cau hinh :
check process apache with pidfile /var/run/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host 127.0.0.1 port 80 then restart
if 5 restarts within 5 cycles then timeout
2. service mysqld co cau hinh:
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group mysql
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout
3. service freeswitch co cau hinh:
check process sip with pidfile /var/run/freeswitch/freeswitch.pid
group freeswitch
start program = "/etc/init.d/freeswitch start"
stop program = "/etc/init.d/freeswitch stop"
if failed host 127.0.0.1 port 8021 type TCP then restart
if 5 restarts within 5 cycles then timeout
4. config monit de dung web :
vi /etc/monit.conf:
set httpd port 2812 and
#use address localhost # only accept connection from localhost
allow 172.30.41.241/255.255.255.0 # allow localhost to connect to the server and
allow localhost # allow localhost to connect to the server and
allow admin:monit # require user 'admin' with password 'monit'
allow @monit # allow users of group 'monit' to connect (rw)
allow @users readonly # allow users of group 'users' to connect readonly