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
Service Dependencies for Hierarchical topology
Re: Service Dependencies for Hierarchical topology
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:
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
Code: Select all
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
https://support.nagios.com/kb/article/n ... t-160.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Service Dependencies for Hierarchical topology
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:
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.
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
}
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.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Service Dependencies for Hierarchical topology
@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.
Re: Service Dependencies for Hierarchical topology
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 .
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 .
Re: Service Dependencies for Hierarchical topology
That makes sense, you would need to script out the dependency generation then in order to get them setup.