Suppressing notifications for a host based on another host for on-demand host checks

John A. Sullivan III jsullivan at opensourcedevel.com
Sun Jul 16 00:38:49 CEST 2006


On Sat, 2006-07-15 at 15:32 -0400, John P. Rouillard wrote:
> Hello all:
> 
> I am running nagios 2.0 and have a single host represented twice
> within nagios. It has two names: a.example.com, a.pub.example.com
> 
> When I (and others) take a.example.com down I disable notifications
> for the host and it's services. However I often forget to do the same
> for it's other instance a.pub.example.com (in reality we have 4 or 5
> names for some hosts corresponding to different IP addresses).
> 
> I was hoping that host dependencies would help in this case by
> simply making a.pub.example.com depend on a.example.com. Then if
> a.example.com was down the notification for a.pub.example.com wouldn't
> go out and neither would the service errors on a.pub.example.com
> (because the host was down).
> 
> However it doesn't work that way according to the manual. Only
> scheduled host checks (not the on-demand checks caused by the loss of
> services on a.pub.example.com) are affected by the host
> dependencies.
> 
> I can't use parent directives either because these interfaces are on
> separate networks and using the parent directives would:
> 
>   1) create a link that doesn't exist (the nagios server is multi-homed)
> 
>   2) create a loop in the parent graph that would cause nagios to fail.
> 
> 
> One way I thought of to do this is to use a new host check plugin for
> a.pub.example.com that returns "unreachable (2)" if a.example.com was
> in an error state. Setting a.pub.example.com to "unreachable" should
> also suppress the notifications done by the core, and the dependency
> can be defined statically in the nagios config files rather than
> dynamically in the plugin. Something like:
> 
>   check_host_with_dependency -H $HOSTADDRESS$ -P $HOSTSTATEID:a.example.com$
> 
> where the plugin returns 2 if $HOSTSTATEID:a.example.com$ is 1 or 2,
> and returns the result of "check_ping" if $HOSTSTATEID:a.example.com$
> is 0. I think this should work according to the manual, does anybody
> disagree?
> 
> Also does anybody have a better way of doing this?
<snip>
I am very new to Nagios so please do not take this as expert advise.
How about using a service dependency instead.  Make the other services
dependent on whatever service is used to check the alive status of the
host.  There are some tips in the manual of making the process of
creating all those service dependencies easier using regular expression,
service groups and host groups.  Hope this helps - John
-- 
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan at opensourcedevel.com

If you would like to participate in the development of an open source
enterprise class network security management system, please visit
http://iscs.sourceforge.net



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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