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? -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions. ------------------------------------------------------------------------- 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@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