Heartbeats を使ったNagiosの監視

Nagios をどのように監視しますか? Opsgenie には、Opsgenie API にハートビート メッセージを送信する使いやすいプラグインがあります。Nagios はこのプラグインを定期的に実行します。Opsgenie が設定可能な期間にハートビートを受信しない場合、メール、iOS および Android のプッシュ通知、SMS、および電話によって、適切なユーザーに通知します。

Opsgenie Nagios プラグインを使用する手順は、次のとおりです。

  1. Opsgenie の Heartbeats ページに移動し、ハートビートを追加します。

  2. Create an API integration API Integration and copy its Api key.

  3. Download the Nagios Heartbeat plugin from its GitHub release page and put the binary file into your Nagios libexec directory.

  4. Nagios で次のようにコマンドを定義します。

 

define command{ command_name opsgenie_heartbeat command_line /usr/local/Nagios/libexec/heartbeat -apiKey $ARG1$ -name $ARG2$ -action send }

EU 向け Heartbeats

If you are configuring the Heartbeats for OpsgenieEU, need to add -apiUrl as https://api.eu.opsgenie.com to command line while defining command, so the command definition will be like below:

 

define command{ command_name opsgenie_heartbeat command_line /usr/local/Nagios/libexec/heartbeat -apiKey $ARG1$ -name $ARG2$ -action send -apiUrl https://api.eu.opsgenie.com }

5. コマンドを実行するサービスを、次のように定義します。

 

define service { service_description OpsGenie Heartbeat host_name localhost check_interval 10 check_period 24x7 max_check_attempts 60 retry_interval 1 notification_interval 60 check_command opsgenie_heartbeat!API_KEY!HEARTBEAT_NAME }

API_KEY は Opsgenie Heartbeats インテグレーションから取得した API キーで、HEARTBEAT_NAME は追加した Heartbeats の名前です。

トラブルシューティング

バイナリ ファイル Heartbeats が実行可能であることを確認します。

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。