Nagios Monitor Server, and NRPE clients, giving funny results

Sean McAfee smcafee at collaborativefusion.com
Fri May 8 14:30:06 CEST 2009


Gabriel - IP Guys wrote:
> I get the concept, NRPE is installed on my client servers, and nagios
> itself is installed on ate server designated the monitor server. This
> server itself also has NRPE installed as it's monitored by a separate
> nagios install, but that's above and beyond this issue. I've been told
> that I cannot pass arguments to NRPE from the monitor server. For
> example, check_nrpe -H client_IP check_disk - is the most that I can
> issue on the monitor server. I guess this then means that in the *.cfg
> files on nagios, everywhere it says check_nrpe!check_disk - there should
> be no arguments after it?
> 
> If this is the case, then I think I found where the guy I replaced made
> a mistake!

I think you may not fully understand how NRPE works - check_nrpe just 
tells a client to run a predefined check.


In your scenario, with a typical NRPE setup, there would be a check on 
the Nagios server :

define command {
         command_name    check_remote_disk
         command_line    $USER1$/check_nrpe2 -H $HOSTADDRESS$ -c 
check_disk -a $ARG1$ $ARG2$
}


And a corresponding entry in the client nrpe.cfg:

command[check_disk]= /usr/local/libexec/nagios/check_disk -w $ARG1$ -c 
$ARG2$

Now to actually make it check:

define service{
         host_name               server.example.com
         service_description     Disk Space Check
         use                     generic-service
         check_command    	check_remote_disk!50!80
}


On the Nagios host, this check is expanded to `check_nrpe2 -H 
server.example.com -c check_disk -a 50 80`, which  is seen by the NRPE 
daemon, and exanded to `/usr/local/libexec/nagios/check_disk -w 50 -c 80`.

Even if you can't pass arguments to the client NRPE because of policy or 
security reasons, you can still pass arguments on to the client-local 
check scripts with a few minor changes.

On Nagios:

define command {
         command_name    check_remote_disk
         command_line    $USER1$/check_nrpe2 -H $HOSTADDRESS$ -c 
check_disk_default
}

define service{
         host_name               server.example.com
         service_description     foo.txt file age
         use                     generic-service
         check_command    	check_remote_disk
}


And finally on the client nrpe.cfg:
command[check_disk_default]= /usr/local/libexec/nagios/check_disk -w 50 
-c 80

The only real tradeoffs to doing it this way are relating to templating 
and configuration centralization, so the hit is restricted to management 
overhead.

-- 
Sean McAfee
System Engineer

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list