Steps done:
**On Nagios Server (CentOS 7)**
yum install nagios nagios-plugins-all
**On Target (CentOS 7)**
yum install nrpe nagios-plugins-all
modified
nrpe.cfg
and added master IP to allowed_hosts
systemctl enable nrpe && systemctl start nrpe
Now I'm trying to add a service check with check_nrpe
so I defined host, contact, contactgroup then check_nrpe command
nano /etc/nagios/objects/commands.cfg
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
then added services for the nrpe check
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 service started successfully
systemctl enable nagios && systemctl start nagios
I can verify check_nrpe returns Ok status directly from CLI
# /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;
but in dashboard check_nrpe check is unable to succeed, due to permissions. (which I had already set as nagios:nagios
for both /etc/nagios
and /usr/lib64/nagios/plugins
)
it's showing this error on dashboard against this check
(Return code of 13 for service 'SYS_HostLoad' on host 'TGT' was out of bounds)
Asked by Sollosa
(1993 rep)
Sep 22, 2021, 10:40 AM
Last activity: Sep 22, 2021, 10:49 AM
Last activity: Sep 22, 2021, 10:49 AM