Parenting question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Parenting question

Post by BanditBBS »

I've asked similar before, but I think you are going to tell me to use both this time.

I want to setup parenting/dependencies so that when the FW in DC#2 can't be pings that everything under it is marked as unreachable, a network outage is listed and all the devices in DC#2 stop getting checked.

So I think I need to set the firewall as parent to everything plus make everything dependent on that FW so I can stop checks from being performed, right? For dependencies, if I do a host dependency, and the FW goes down so all hosts are unreachable because of parenting and then the checks of hosts stop because of the dependency, will the services still be checked or do they inherit the behavior of the host?

If I am off base, what's the easiest way(if any) to get my desired functionality?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Parenting question

Post by Box293 »

I had a good read of this here:

http://markmail.org/message/4tgfg6zxy47 ... te:results
Answer to myself... After some investigations and doc readings :-) it seems I made a little confusion between "parent/child" and "dependency" :

- Parent/Child relationship is for hosts only, and should map network topology. When a host is DOWN, all the children are set to UNREACHABLE. But this parent/child relationship does not exist for services.

- Dependency can be either for hosts or services. When a dependant object is down, the "depended upon" object is not checked. But no assumption is made to the "depended upon" object status. Thus, it is not set to UNREACHABLE or UNKNOWN, such as for parent/child relationship.

Here's the actual situation :

- Creating a dependancy solves my problem of not checking services when hosts are unreachable due to WAN failure. This is a smarter solution than my previous attempt using event_handlers and DISABLE_ALL_SVC_CHECKS external command. Using wildcards, I just have to declare one dependency for all services on several hosts like this :

define servicedependency{
host_name Remote_WAN_Router
service_description Remote WAN router ping test
dependent_host_name REMOTE_HOST1, REMOTE_HOST2, ..., REMOTE_HOSTn
dependent_service_description *
inherits_parent 1
execution_failure_criteria w,u,c
}

- Doing that, when the WAN fails, the checks are not executed, and they keep their previous status. That's a good thing. But I would have prefered they get the status UNKNOWN or UNREACHABLE. In fact, I would like to have the same parent/child behavior that exists for hosts, but for services.
So it would appear that you need both.

Service parents appear to be new in Core 4, however this has been logged as a bug here:

http://tracker.nagios.org/view.php?id=562
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Parenting question

Post by BanditBBS »

Thanks Troy. One part of my post is still a question though....

If I set host1, host 2 and host3 dependent on the firewall and the firewall goes down will only the host checks be stopped on host1 host 2 and host3 or also all the services? Because if I have to create service dependencies too, then that'd be an administration nightmare and something I'd have to code instead.

Edit - Service dependency does allow use of an *, so maybe wouldn't be bad if I have to do them too, just use same hostgroup as I do for host dependency and select the *.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Parenting question

Post by Box293 »

OK so sometimes I just need to go away and play to get the right answer :)

Top parent = centos01
Children = win7-01 and win7-02
All hosts also have a ping service.


With just the parent definitions.
Take centos01 offline - all hosts and services continue to be checked as per their normal intervals.


With a host dependency defined:

define hostdependency {
dependent_host_name win7-01,win7-02
host_name centos01
inherits_parent 1
execution_failure_criteria u,d,
dependency_period 24x7
}

Take centos01 offline -
centos01 host and service continue to be checked as per their normal intervals.
win7-01 and win7-02 host objects keep getting their next check pushed back as per the host dependency.
win7-01 and win7-02 service objects continue to be checked as per their normal intervals.


With a service dependency also defined:

define servicedependency {
dependent_host_name win7-01,win7-02
dependent_service_description *
host_name centos01
service_description Ping
inherits_parent 1
execution_failure_criteria w,u,c,
}

Take centos01 offline -
centos01 host and service continue to be checked as per their normal intervals.
win7-01 and win7-02 host objects keep getting their next check pushed back as per the host dependency.
win7-01 and win7-02 service objects keep getting their next check pushed back as per the service dependency.


So the answer is, you need both host and service dependencies.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Parenting question

Post by BanditBBS »

That's the most well explained answer :) thanks
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Parenting question

Post by tmcdonald »

BanditBBS wrote:That's the most well explained answer :) thanks
Would you expect anything else from Troy? :)

I assume we can lock this?
Former Nagios employee
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Parenting question

Post by BanditBBS »

Trevor, sure, close it up.

I can't decide how I'm going to do this though...I'd really love to not perform checks, but I'd also love to see everything marked as unreachable...hmmmm
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked