
全ステップ:
Nagiosサーバー(CentOS 7)
yum install nagios nagios-plugins-all
目標達成(CentOS 7)
yum install nrpe nagios-plugins-all
nrpe.cfg
デフォルトIPを変更して追加します。allowed_hosts
systemctl enable nrpe && systemctl start nrpe
check_nrpeを使用してサービスチェックを追加したいので、ホスト、連絡先、連絡先グループを定義してからcheck_nrpeコマンドを定義しました。
nano /etc/nagios/objects/commands.cfg
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
その後、nrpe検証サービスを追加しました。
nano /etc/nagios/objects/services.cfg
define service {
use basic-new-service
name check-load-service
normal_check_interval 3
retry_check_interval 1
notification_interval 30
notification_options w,c,r,u
check_command check_nrpe!check_load
register 0
}
define service {
use check-load-service
service_description SYS_HostLoad
contact_groups Audit
host_name TGT
}
nagiosサービスが正常に開始されました
systemctl enable nagios && systemctl start nagios
check_nrpe が CLI から直接 Ok 状態を返すことを確認できます。
# /usr/lib64/nagios/plugins/check_nrpe -H TGT -c check_load
OK - load average per CPU: 0.00, 0.00, 0.01|load1=0.000;0.150;0.300;0; load5=0.002;0.100;0.250;0; load15=0.008;0.050;0.200;0;
しかし、権限の問題でダッシュボードのcheck_nrpeチェックインが成功しませんでした。 (私はnagios:nagios
との両方に/etc/nagios
設定しました/usr/lib64/nagios/plugins
。)この確認のために、ダッシュボードにこのエラーが表示されます。
(Return code of 13 for service 'SYS_HostLoad' on host 'TGT' was out of bounds)