第5章 Ceph 向け Nagios プラグインの設定
Red Hat Ceph Storage クラスターの場合には、Nagios プラグインを設定します。
前提条件
- Ceph Monitor ノードへのユーザーレベルのアクセス。
- 稼働中の Red Hat Ceph Storage クラスター
- Nagios Core Server へのアクセス
手順
monitor サーバーにログインし、Nagios の Ceph キーとキーリングを作成します。
[user@mon]# ssh mon [user@mon]# cd /etc/ceph [user@mon]# ceph auth get-or-create client.nagios mon 'allow r' > client.nagios.keyring
各プラグインには認証が必要です。プラグインが含まれる各ノードで、この手順を繰り返します。
check_ceph_health
プラグインのコマンドを追加します。[user@mon]# vi /usr/local/nagios/etc/nrpe.cfg
例
command[check_ceph_health]=/usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyring
nrpe
サービスを有効にして再起動します。[user@mon]# systemctl enable nrpe [user@mon]# systemctl restart nrpe
ノードに適用される各 Ceph プラグインに対して、この手順を繰り返します。
Nagios Core サーバーに戻り、NRPE プラグインの
check_nrpe
コマンドを定義します。[user@nagios]# cd /usr/local/nagios/etc/objects [user@nagios]# vi commands.cfg
define command{ command_name check_nrpe command_line USER1/check_nrpe -H HOSTADDRESS -c ARG1 }
Nagios Core サーバーで、ノードの設定ファイルを編集し、Ceph プラグインのサービスを追加します。
例
[user@nagios]# vi /usr/local/nagios/etc/objects/mon.cfg
define service { use generic-service host_name mon service_description Ceph Health Check check_command check_nrpe!check_ceph_health }
注記check_command
設定では、Ceph プラグイン名の前にcheck_nrpe!
を使用します。これにより、リモートノードでcheck_ceph_health
コマンドを実行するように NRPE に指示します。- このノードに適用される各プラグインに対して、この手順を繰り返します。
Nagios Core サーバーを再起動します。
[user@nagios]# systemctl restart nagios
追加の設定を進める前に、このプラグインが機能していることを確認します。
例
[user@mon]# /usr/lib/nagios/plugins/check_ceph_health --id nagios --keyring /etc/ceph/client.nagios.keyring
注記check_ceph_health
プラグインは、ceph health
コマンドと同等のコマンドを実行します。
関連情報
- 使用方法は、Ceph Nagios プラグインの Web ページ を参照してください。