I think NRPE is not supposed to work with nagios 4 ; cf
this page
Compatible With
Nagios 1.x
Nagios 2.x
Nagios 3.x
I have the same problem about define check_nrpe :
Error: Service check command 'check_nrpe' specified in service 'CPU LOAD' for host 'server2' not defined anywhere!
Then I also tried to lauch the check_nrpe directly in a shell.
I had the same error :
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
It sounds normal, from far I've understood how nrpe is supposed to work, this kind of commands are detailed with parameters in nrpe.cfg (for ScientificLinux 6.5, this file is in /etc/nagios/nrpe.cfg).
# The following examples use hardcoded command arguments...
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
Then, without the option, the commande works for me :
[root@server1 nagios]# /usr/lib64/nagios/plugins/check_nrpe -H ip_of_server2 -c check_load
OK - load average: 0.15, 0.08, 0.02|load1=0.150;15.000;30.000;0; load5=0.080;10.000;25.000;0; load15=0.020;5.000;20.000;0;
[root@server1 nagios]#
But I've still this error about check_nrpe not defined, and I stuck on it.
I've followed a tutorial and made an /etc/nagios/servers/ directory with myServer.cfg file inside, where I defined things like this :
define host{
use linux-server
host_name server2
alias server2
address 192.168.xxx.xxx
max_check_attempts 5
check_period 24x7
notification_interval 5
notification_period 24x7
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
define service {
use generic-service
host_name server2
service_description SSH
check_command check_ssh
notifications_enabled 1
}
define service {
use generic-service
host_name server2
service_description CPU LOAD
check_command check_nrpe!check_load
}
Everything was OK until I added this nrpe's service (with only ssh service, it was working well).
In some places, I read that check_nrpe is supposed to be define in /etc/nagios/commands.cfg, but I've not this file, only 'lcgdm-commands.cfg'.
Creating a command.cfg in /etc/nagios doesn't help and nagios still unstartable.
Any idea welcome
