0

I'm a little baffled by this - I set up Nagios3's server process on one machine (tala) and NPRE on two others (medea and iiyanara.), and thought it was set up correctly. For various frustrating reasons I had to rebuild medea from a disk image, and as a result NPRE isn't installed anymore.

Imagine my surprise when Nagios is (days later) continuing to merrily report not only that my server is up, but also a series of performance metrics like total processes, etc. As it turns out, I'm pretty sure the Nagios instance has actually been reporting on localhost for both medea and iiyanara all along.

Here's the initial block + first service block from medea.conf:

define host{
    use                     generic-host            ; Name of host template to use
    host_name               medea.phyre.im
    alias                   Medea
    address                 97.107.128.112
    }

define service{
    use                             generic-service         ; Name of service template to use
    host_name                       medea.phyre.im
    service_description             Disk Space
    check_command                   check_all_disks!20%!10%
}

Curiously, if I specify a different IP, Nagios reports that the machine is down. So either:

  1. Nagios is using black sorcery to commune with medea despite a total absence of the NPRE service
  2. Nagios is reporting on localhost for some reason

...And then it STOPS doing those things if I specify, for instance, 197.107.128.112 as the target IP.

My question is basically this: what the hell?

2 Answers 2

2

check_all_disks probably uses check_disk plugin which check amount of used space of locally mounted filesystems.

You should use something like:

check_nrpe!check_all_disks
1
  • You're absolutely correct. Wow do I feel dumb. Thanks a mint :)
    – Sudowned
    Nov 19, 2012 at 10:04
0

Check http://www.kernelhardware.org/nagios-nrpe-to-monitor-remote-linux-server/

In short For disk check & CPU check in /etc/nagios/objects/commands.cfg add the following

# for nrpe check_disk plugin
define command{
        command_name    check_disk
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }   

# for nrpe check_load plugin
define command{
        command_name    check_load
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }

in /etc/nagios/objects/localhost.cfg where server1

define service{
        use                             local-service         ; Name of service template to use
        host_name                       server1
        service_description             Root Partition
        check_command                   check_disk!check_disk
        contact_groups                  admins
        }
define service{
        use                             local-service         ; Name of service template to use
        host_name                       server1
        service_description             Current Load
        check_command                   check_load!check_load
        contact_groups                  admins
        }

check if config is ok with

#nagios -v /etc/nagios/nagios.cfg

reload the nagios

#/etc/rc.d/rc.nagios reload

You must log in to answer this question.

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