ksaitoの日記

日々試したことの覚え書き

NagiosのWebインタフェースを設定する

NagiosのWebインタフェースには、監視対象のサーバの障害対応中に通知メールを大量に送信しないように"Acknowledge this service problem"というステータスにして簡単なコメントを入力できます。Webインターフェースには、工事中のアイコンが表示され障害対応中という通知メールが送信され、障害対応完了まで監視対象から外れます。

デフォルトでは、設定されていないため、コメントを入力すると下記のようなメッセージが表示されます。

Sorry, but Nagios is currently not checking for external commands, so your command will not be committed!

Read the documentation for information on how to enable external commands...

Return from whence you came

下記のようにcheck_external_commands=1に設定してNagiosを再起動します。

$ hg diff
diff -r 0c1e8c4edfd2 nagios.cfg
 --- a/nagios.cfg	Wed Mar 11 07:28:02 2009 +0900
 +++ b/nagios.cfg	Wed Mar 11 07:36:33 2009 +0900
 
 -check_external_commands=0
 +check_external_commands=1
  
$ sudo /etc/init.d/nagios3 restart
 * Restarting nagios3 monitoring daemon nagios3                                 
                                                                         [ OK ]
$

今度は、下記のようなメッセージが表示されます。

Error: Could not stat() command file '/var/lib/nagios3/rw/nagios.cmd'!

The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands.

An error occurred while attempting to commit your command for processing.

Return from whence you came

nagios2の手動のステータス変更でエラーでnagios2で設定したときと同じ設定で動作するようになりました。

$ sudo dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
$ sudo dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
ksaito@ubuntu10$ sudo /etc/init.d/nagios3 restart
 * Restarting nagios3 monitoring daemon nagios3                                 
                                                                         [ OK ]
$ 

今度は、ステータス変更とコメントの登録ができました。

Your command request was successfully submitted to Nagios for processing.

Note: It may take a while before the command is actually processed.

Done