Heartbeats を使ったNagiosの監視
Nagios をどのように監視しますか? Opsgenie には、Opsgenie API にハートビート メッセージを送信する使いやすいプラグインがあります。Nagios はこのプラグインを定期的に実行します。Opsgenie が設定可能な期間にハートビートを受信しない場合、メール、iOS および Android のプッシュ通知、SMS、および電話によって、適切なユーザーに通知します。
Opsgenie Nagios プラグインを使用する手順は、次のとおりです。
Opsgenie の Heartbeats ページに移動し、ハートビートを追加します。
Create an API integration API Integration and copy its Api key.
Nagios Heartbeats プラグインを GitHub リリース ページからダウンロードして、バイナリ ファイルを Nagios libexec ディレクトリに置きます。
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 の名前です。
For details about defining command and service in Nagios, see Nagios Object Definitions doc.
Opsgenie Heartbeats の詳細とその使用方法については、Heartbeats 監視ドキュメントを参照してください。
Source code of the Heartbeat Plugin is available at GitHub
トラブルシューティング
バイナリ ファイル Heartbeats が実行可能であることを確認します。
この内容はお役に立ちましたか?