I make a service SVC-X-1. I inherit a service template ST-X. ST-X inherits service template ST-cmd which has the command definitions on it. ST-cmd inherits also adds a servicegroup SG-base. ST-cmd then inherits ST-X-host which has the hostgroup HG-X on it. So we have a base service definition with all the commands, arguments, and hosts identified via service templates and hostgroups. Service template ST-X also adds a service group called SG-X. Now SVC-X-1 is in SG-base and SG-X, runs on the hosts specified in HG-X, and runs the command specified in ST-cmd. Repeat this for SVC-X-2 through SVC-X-9 for a total of 9 of these service checks (just for the sake of argument). Now do again for Y and Z so you end up with SG-X, SG-Y, and SG-Z.
So far, no service is assigned to a host, hostgroup, or servicegroup directly. Here comes the problem.
Now we want to make SVC-X-* dependent upon SVC-Agent. So we head to service dependencies and make Host-X our dependent host, and SVC-Agent our dependent service. Then we make Host-X our non-dependent host and all of the SG-* servicegroups that we created as part of this.
It doesn't pass config test muster. Complains that it can't expand the servicegroup_name and won't let me make servicegroups dependent on up a service. Here's the resulting config entry:
Code: Select all
define servicedependency {
# config_name NRPE Checks
dependent_host_name SVGP-d01.smartvox.net
dependent_service_description NRPE Server
host_name host-X.everwatch.global
inherits_parent 1
execution_failure_criteria c,
notification_failure_criteria c,
dependency_period 24x7
servicegroup_name SG-1,SG-2,SG-3
}