Check NRPE APT now working through Nagios

I'm able to monitor hosts' package statuses via terminal; but Nagios web ui gives an error like this:

(No output returned from plugin)

Here's the command that works properly via terminal:

/usr/lib/nagios/plugins/check_nrpe -H myhost -c check_apt

My Nagios service description for check apt updates:

define service {
        hostgroup_name                  debian-servers
        service_description             Check apt updates
        check_command                   check_nrpe!check_apt
        use                             generic-service
        normal_check_interval           5       ; Check the service every 10 minutes under normal conditions
        retry_check_interval            1       ; Re-check the service every minute until its final/hard state $
        notification_interval           0       ; set > 0 if you want to be renotified
        contact_groups                  admins
}

By the way my Nagios version is 3.2.3.


Solution 1:

This is debian/ubuntu, right? Go look at /etc/nagios-plugins/config/check_nrpe.cfg

The packaged NRPE plugin has a conf that defines check_nrpe as needing an additional ARG, and check_nrpe_1arg as the check that doesn't need an ARG:

# this command runs a program $ARG1$ with arguments $ARG2$
define command {
command_name    check_nrpe
command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}

# this command runs a program $ARG1$ with no arguments
define command {
command_name    check_nrpe_1arg
command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

Personally, I rename them to avoid confusion. (This confuses a lot of people.)