2016-05-12 11 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 

は私が再起動システムmonitは実行されていません。

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

アップスタートを設定してmonitを実行して監視する方法を教えてください。

答えて

0

私はstart monitコマンドで設定ファイルに間違ったパスを持っていました。私はそれを殺すときに、正しいコマンドは、それはデーモンと再起動としてMONITを開始

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

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

です:

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 
関連する問題