-1

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.

2 Answers 2

2

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.)

1
  • I get as an example NRPE: Command 'check_apt!-l' not defined if I run /usr/lib/nagios/plugins/check_nrpe -H 192.168.0.11 -c check_apt -a -l. If I run /usr/lib/nagios/plugins/check_apt -l for the local machine it works.
    – Micha93
    Jun 7, 2021 at 12:15
0

The fact that the check is working via terminal proves that there are no network issues o service problems on the checked host. It would be useful to see the check_nrpe command definition, however you could enable debug by setting debug_level=256 in your nagios.cfg file:

# This option determines how much (if any) debugging information will
# be written to the debug file.  OR values together to log multiple
# types of information.
# Values: 
#          -1 = Everything
#          0 = Nothing
#          1 = Functions
#          2 = Configuration
#          4 = Process information
#          8 = Scheduled events
#          16 = Host/service checks
#          32 = Notifications
#          64 = Event broker
#          128 = External commands
#          256 = Commands
#          512 = Scheduled downtime
#          1024 = Comments
#          2048 = Macros

debug_level=256

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .