Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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
share|improve this answer
    
You're absolutely correct. Wow do I feel dumb. Thanks a mint :) –  Sudowned Nov 19 '12 at 10:04

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.