Page 1 of 1

NRPE command errors in web interface

Posted: Fri Oct 03, 2014 5:53 pm
by xpac
So I set up an Nagios server and added a few hosts that will be monitored in my test environment. I just followed a regular plain jane install and haven't added any plugins yet.

When I look at the first remote host in the web interface under "View Status Detail for this Host" I see a few status errors:

NRPE: Command 'check_total_users' not defined
NRPE: Command 'check_ftp' not defined
NRPE: Command 'check_ssh' not defined

I'm wondering if this is normal with a brand new installation, or did I just screw something up (very possible :lol: )

Re: NRPE command errors in web interface

Posted: Fri Oct 03, 2014 8:37 pm
by millisa
Here is your reference on NRPE and how it works
Those are commands that are not defined on the remote host you are trying to monitor with nrpe. It's not saying 'nagios doesnt know what these commands are' it's saying 'nagios asked NRPE on the other host for check_total_users and the NRPE service on that other server doesnt know what this command is'

Nagios is running something along the lines of 'check_nrpe -H ip-or-hostname -c remotecommand-like-check_total_users'

The check_total_users / check_ftp / check_ssh needs to exist as a defined command that can be run in the nrpe config on that remote host you are checking.

For example, a remote system (let's say it is 192.168.123.59 for hostname 'superduperhost4') might have the following defined in its nrpe config:

Code: Select all

command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
I would then have a check on the nagios server that is checking it with a definition like:

Code: Select all

define command {
        command_name    check_nrpe_check-procs
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_total_procs
}
and a service definition like

Code: Select all

define service{
        use                             myservicetemplate
        host_name                       superduperhost4   #this will make a service check use HOSTADDRESS 192.168.123.59 from the host definition
        service_description             nrpe-totalprocs-check
        check_command                   check_nrpe_check-procs
        }
It'd be normal to see that the command's aren't defined until you define them on the remote hosts NRPE (and in this case, if you are checking your local nagios instance, you'd need to set them up in your local nagios's NRPE config).

Re: NRPE command errors in web interface

Posted: Mon Oct 06, 2014 11:13 am
by abrist
millisa is absolutely on point. Have you had a chance to revisit your configs xpac?

Re: NRPE command errors in web interface

Posted: Fri Oct 24, 2014 12:39 pm
by xpac
Sorry, I forgot this thread was still open :D

Yes I was able to figure it out, and fix the commands, etc so this thread can be closed :D