host-check on multi interface server

Ethan Galstad nagios at nagios.org
Wed Feb 26 03:18:49 CET 2003


On 25 Feb 2003 at 20:10, Karl DeBisschop wrote:

> On Tue, 2003-02-25 at 15:20, Markus Schencker wrote:
> > On Tuesday 25 February 2003 04:14, you wrote:
> > 
> > [...]
> > 
> > > If I read this right, at least one or two folks out there would like a
> > > variant of check_f?ping that accepted multiple IPs and returned an error
> > > status only if all the IPs were unreachable.
> > >
> > > A plugin with that behavior is not too hard. It could be done as a new
> > > feature pretty quickly, once we get the 1.3.0 plugins released. I don't
> > > think you can specify multiple IPs for a host defintion, however (of
> > > course I cold be wrong, I have not come close to fully using the power
> > > of the templated configs).
> >
> > Some host check of this kind would be nice.
> >
> > > But even so, you can define the needed host check command -- you would
> > > need to do it once for each interface in order to list them explicitly.
> >
> > Can I specify more than one host_check per system? It is possible to specify 
> > some host_check and use a list of IP addresses as parameter but what IP 
> > address would the $HOPSTNAME$ macro contain used by the service checks? I 
> > fear it might be not as simple as it seems at the first glance
> 
> I think extending check_ping as discribed is a worthwhile tack (another
> way of saying it solves a problem I have ;-).
> 
> Until then, you could make a little shell wrapper that invokes ping
> directy
> 
> #!/bin/sh
> # my_ping_wrapper
> 
> if [ "z$1" != "z" ] ; then
>   if ping -n -c 1 $1 ; then
>     exit 0
>   else
>     shift
>   fi
> fi
> exit 2
> 
> 
> then define a check_host_alive_<nost1> that looks a little like:
> 
> /usr/lib/nagios/plugins/my_ping_wrapper <list IP addresses for host 1>
> 
> That could be made to work today.
> 
> An enhanced plugin that replces the wrapper can be made in a few weeks.
> 
> Maybe if Ethan is following the thread, he can comment on the wisdom of
> this approach, and on how hard it would be to put multiple IP addesses
> per host for the next release on nagios.
> 

I just added a FAQ for this at:

http://www.nagios.org/faqs/viewfaq.php?faq_id=146

Basically, you can specify multiple addresses.  Nagios doesn't care 
what the host address looks like - it just passes the address to 
commands via the $HOSTADDRESS$ macro.  It's up the host check command 
(and possibly service checks, etc.) to figure out how to interpret 
the format of that address.

Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org



-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
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