2016-05-12 54 views
0

我正在使用監控來監控我的Web服務。一切正常,直到monit進程停止。有monit的日誌文件的一部分在系統殺死後自動重啓監控

monit log file

具有由我添加的monit配置系統(我運行Ubuntu 14.04),它看起來像這樣監測的monit:

# This is an upstart script to keep monit running. 
    # To install disable the old way of doing things: 
    # 
    # /etc/init.d/monit stop && update-rc.d -f monit remove 
    # 
    # then put this script here: 
    # 
    # /etc/init/monit.conf 
    # 
    # and reload upstart configuration: 
    # 
    # initctl reload-configuration 
    # 
    # You can manually start and stop monit like this: 
    # 
    # start monit 
    # stop monit 
    # 

    description "Monit service manager" 

    limit core unlimited unlimited 

    start on runlevel [2345] 
    stop on starting rc RUNLEVEL=[016] 

    expect daemon 
    respawn 

    exec /usr/bin/monit -c /etc/monitrc 

    pre-stop exec /usr/bin/monit -c /etc/monitrc quit 

當我重新啓動系統監視未運行。

sudo monit status 
    $ monit: Status not available -- the monit daemon is not running 

如何配置新貴以保持監控運行?

回答

0

我在start monit命令中配置文件路徑錯誤。正確的命令是

exec /usr/bin/monit -c /etc/monit/monitrc 

    pre-stop exec /usr/bin/monit -c /etc/monit/monitrc quit 

當我殺了它它開始的monit作爲守護進程,並重新啓動:

ps aux | grep monit 
    root  2173 0.0 0.1 104348 1332 ?  Sl 04:13 0:00 /usr/bin/monit -c /etc/monit/monitrc 

    sudo kill -9 2173 

    ps aux | grep monit 
    root  2184 0.0 0.1 104348 1380 ?  Sl 04:13 0:00 /usr/bin/monit -c /etc/monit/monitrc 
相關問題