monitでプロセスの監視と再起動
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[monit]]
*環境 [#dbc97fa3]
CentoS6
*httpd [#r0c93307]
# cd /etc/monit.d
# vim httpd.rc
---
check process httpd
with pidfile "/var/run/httpd/httpd.pid"
start program "/etc/init.d/httpd start"
stop program "/etc/init.d/httpd stop"
if failed
host サイトURL(もし名前解決できないテスト用のUR...
port 80
protocol http
then restart
if 5 restarts within 5 cycles then timeout
---
# monit -t
Control file syntax OK
# service monit restart
monit を停止中: ...
monit を起動中: ...
# monit status
The Monit daemon 5.14 uptime: 0m
Process 'httpd'
status Running
monitoring status Monitored
pid 16903
parent pid 1
uid 0
effective uid 0
gid 0
uptime 3m
children 8
memory 11.4 MB
memory total 66.1 MB
memory percent 0.3%
memory percent total 2.2%
cpu percent 0.0%
cpu percent total 0.0%
port response time 0.003s to [サイトURL...
data collected Wed, 16 Dec 2015 17:4...
*postfix [#le9f0edc]
# cd /etc/monit.d
# vim postfix.rc
---
check process postfix with pidfile /var/spool/postfix/pi...
group mail
start program = "/etc/init.d/postfix start"
stop program = "/etc/init.d/postfix stop"
if failed port 25 protocol smtp then restart
if 5 restarts within 5 cycles then timeout
---
# monit -t
Control file syntax OK
# service monit restart
monit を停止中: ...
monit を起動中: ...
# monit summary
Process 'postfix' Running
終了行:
[[monit]]
*環境 [#dbc97fa3]
CentoS6
*httpd [#r0c93307]
# cd /etc/monit.d
# vim httpd.rc
---
check process httpd
with pidfile "/var/run/httpd/httpd.pid"
start program "/etc/init.d/httpd start"
stop program "/etc/init.d/httpd stop"
if failed
host サイトURL(もし名前解決できないテスト用のUR...
port 80
protocol http
then restart
if 5 restarts within 5 cycles then timeout
---
# monit -t
Control file syntax OK
# service monit restart
monit を停止中: ...
monit を起動中: ...
# monit status
The Monit daemon 5.14 uptime: 0m
Process 'httpd'
status Running
monitoring status Monitored
pid 16903
parent pid 1
uid 0
effective uid 0
gid 0
uptime 3m
children 8
memory 11.4 MB
memory total 66.1 MB
memory percent 0.3%
memory percent total 2.2%
cpu percent 0.0%
cpu percent total 0.0%
port response time 0.003s to [サイトURL...
data collected Wed, 16 Dec 2015 17:4...
*postfix [#le9f0edc]
# cd /etc/monit.d
# vim postfix.rc
---
check process postfix with pidfile /var/spool/postfix/pi...
group mail
start program = "/etc/init.d/postfix start"
stop program = "/etc/init.d/postfix stop"
if failed port 25 protocol smtp then restart
if 5 restarts within 5 cycles then timeout
---
# monit -t
Control file syntax OK
# service monit restart
monit を停止中: ...
monit を起動中: ...
# monit summary
Process 'postfix' Running
ページ名: