9

So I have the following in my monitrc file:

check process apache with pidfile /usr/local/apache/logs/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host XXX port 80 protocol http
and request "/monit/token" then restart
if cpu is greater than 60% for 2 cycles then alert
if cpu 80% for 5 cycles then restart
if totalmem 500 MB for 5 cycles then restart
if children 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout

but I keep getting the error that:

Error: service name conflict, apache already defined '/usr/local/apache/logs/httpd.pid'
4

7 に答える 7

12

サーバーのホスト名が「apache」の場合、システム負荷を監視するためのデフォルト ルールと競合しています。

Monit には、ホスト名が hostname コマンドの出力である「check system hostname」という暗黙のルールがあるようです。

次のような行を追加するだけで上書きできます。

check system newhostname

例えば:

check system localhost
于 2013-01-25T17:18:28.520 に答える
3

ひょっとして、このエントリの下または別の monit 構成ファイルにホスト名 apache のエントリがありますか?

于 2012-02-25T22:33:45.153 に答える
0

ディレクトリのmonit conf下のファイルのいずれかで定義された Apache の競合があったかどうかを確認してください。誤って追加してしまい、以前に同じエラーが発生しました。/etc/monit.d/nginxpuma.conf

于 2015-10-21T18:53:32.720 に答える
0

私の場合、monitサービス名のエラーを取り除くために再起動するだけで済みました。

sudo service monit restart

于 2017-10-04T09:40:49.170 に答える