LoginSignup
1
0

More than 3 years have passed since last update.

Xymonで監視対象から削除したのにログが出力される

Posted at

概要

死活監視ソフトであるXymonをCentOS6で利用していましたが、以下のような症状が発生。

  • 既存の監視対象ホストを削除
    1. /etc/xymon/hosts.d/hoge から対象ホスト行を削除
    2. $ xymon 127.0.0.1 "drop <対象ホスト名>" コマンドを実行

これでウェブ画面から対象ホストは消え、アラートも通知されなくなりました。
が、後日xymonのアラートログ(/var/log/xymon/alert.log)を確認すると、削除したはずのホストのアラートログが出力され続けていました。

$ grep "which is not yet defined" /var/log/xymon/alert.log
2020-01-29 09:00:00 Checking criteria for host '<対象ホスト名>', which is not yet defined; some alerts may not immediately fire
2020-01-29 09:02:00 Checking criteria for host '<対象ホスト名>', which is not yet defined; some alerts may not immediately fire
2020-01-29 09:04:00 Checking criteria for host '<対象ホスト名>', which is not yet defined; some alerts may not immediately fire
...

削除したはずのホストが何故??1ホストだけならまだしも、今回は結構な数のホストで発生しており、無駄にディスク容量が消費されていました。ログローテートがあると言ってもこのまま放置するわけにも行かないので調査開始。

解決

ぐぐるとドンピシャな情報が!
https://xymon.xymon.narkive.com/UOEFtn72/bogus-hosts-filling-up-alert-log

If there had been a previous alert for the virtual/fake host, it would
have been stored in memory, and frozen out into the alerts.chk file
(probably in /var/lib/xymon/tmp/ during restarts).

The general reason for the alert is that xymond(_alert) is getting a
report about something it doesn't (yet) know about. Usually, this clears
a few minutes later as soon as xymond next checks hosts.cfg for changes,
since typically that's the action pending to be taken.

ほうほう。ggr翻訳しながら読み進める。

Adding the host to hosts.cfg and then dropping it should work for
clearing out the errant alert. Alternatively, you can stop xymon (or at
least xymond_alert, by adding DISABLED into tasks.cfg), grep out the
line for the alert in alerts.chk manually (it's just a normal
single-line-record text file, and then bring it back up.

とあったので、簡単そうな以下手順を試みる。

  1. Xymonデーモン停止
  2. /var/lib/xymon/tmp/alert.chk から対象ホスト行を除去
  3. Xymonデーモン開始
# Xymonデーモン停止
$ service xymon stop
# alert.chk から対象ホスト行を削除(今回ファイル内には削除したホストしか記載されていなかったので丸ごとクリア)
$ cat /dev/null > /var/lib/xymon/tmp/alert.chk
# Xymonデーモン開始
$ service xymon start

これでしばらくtail -f /var/log/xymon/alert.logで様子を見ていましたが、削除ホストログが出力される事がなくなりました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0