Nagios “Service check command ‘check_nrpe’ not defined anywhere” fix

Fix for :

Checking services…
Error: Service check command ‘check_nrpe’ specified in service ‘LOAD’ for host ‘server_name’ not defined anywhere!

In order to make check_nrpe working on the configuration file need to add the following lines on the  /etc/nagios/objects/commands.cfg

define command{
                                command_name check_nrpe
                                command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

Restart the nagios service after.

The configuration on the server will look like:

define service {
        use                                    generic-service
        host_name                      server_name
        service_description       LOAD
        check_command           check_nrpe!check_load

To test if the configuration is working:

/usr/sbin/nagios -v /etc/nagios/nagios.cfg

To test the load on the server command line try the below command. This should work without the first adjustment in commands.cfg

 /usr/lib64/nagios/plugins/check_nrpe -H 1server_name -c check_load

All this need to be done on the server. I have tested this configuration on CentOS 6.5 86_64. All the installation was done from repository. The configuration will vary if you install nagios server from source.


Leave a Reply

Time limit is exhausted. Please reload the CAPTCHA.