Service Dependencies for Hierarchical topology

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
parisa
Posts: 62
Joined: Tue Sep 25, 2018 3:18 am

Service Dependencies for Hierarchical topology

Post by parisa »

Hi
I have more than 1000 hosts, each of these hosts have around 25 services.(1000*25 services) and I use passive check.
The hosts connects to each other in form of a tree and i have a service for each host that the service depends on the same service of its parent.

For more explanation:
host_A is parent of host_B and host_B is parent of host_C and host_C is parent of host_D and ... . All of the hosts have service_1
I want to configure service dependencies for them as below.

define servicedependency{
host_name host_A
service_description service_1
dependent_host_name host_B
dependent_service service_1
inherits_parent 1
}

define servicedependency{
host_name host_B
service_description service_1
dependent_host_name host_C
dependent_service service_1
notification_failure_criteria w,u,c
inherits_parent 1
}

define servicedependency{
host_name host_C
service_description service_1
dependent_host_name host_D
dependent_service service_1
inherits_parent 1
}


Because of topology of my hosts is Hierarchical (in form of tree) and a branch of the topology can be more than 6 levels, are there a way that I don't have to define the dependency for all of hosts for the service one by one?

Thanks
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Service Dependencies for Hierarchical topology

Post by lmiltchev »

I don't see how this can be done in the GUI. You could probably come up with some kind of scripting solution in order to add the dependencies from the CLI. Then, you could place the servicedependencies.cfg in the /usr/local/nagios/etc/import directory, and run:

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
If you wished to manage these dependencies manually, you could place them in the static directory. Read more about the manual config file management here:

https://support.nagios.com/kb/article/n ... t-160.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
parisa
Posts: 62
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Dependencies for Hierarchical topology

Post by parisa »

Thanks for your answer
I have another question,If I define service dependencies for services of each host, for examples:
all hosts have some services (service_1, service_2,..., service_7) and are defined dependencies as below:

Code: Select all

define servicedependency{
host_name    host_A
service_description    service_1
dependent_host_name    host_A
dependent_service   service_2,service_3,service_4,service_5,service_6,service_7
inherits_parent	    1
}

define servicedependency{
host_name    host_A
service_description    service_2
dependent_host_name    host_A
dependent_service   service_3,service_4,service_5,service_6,service_7
inherits_parent	    1
}
should I define the service dependency for any host one by one or use scripting solution? are there another solution for it?

I have used scripting to define some dependencies, I need to define other dependencies, so I wanted to make sure that there are another way or not.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service Dependencies for Hierarchical topology

Post by npolovenko »

@parisa, Scripting or manually creating these dependencies is the only way I can think of. Are you creating dependencies to prevent excessive notifications? Did you know that if a host goes into a critical state, none of its services will send any notifications? This is automatic.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
parisa
Posts: 62
Joined: Tue Sep 25, 2018 3:18 am

Re: Service Dependencies for Hierarchical topology

Post by parisa »

Thanks for your attention

I use SNMP Trap to monitor my services and have event handler for the services, I will create dependencies to prevent excessive notifications and also event handler is not executed .
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Service Dependencies for Hierarchical topology

Post by ssax »

That makes sense, you would need to script out the dependency generation then in order to get them setup.
Locked