BOOST_FOREACH(const Dependency::Ptr& dep, DynamicType::GetObjects<Dependency>()) {
Checkable::Ptr parent = dep->GetParent();
- if (!parent)
+ if (!parent) {
+ Log(LogDebug, "compat", "Missing parent for dependency '" + dep->GetName() + "'.");
continue;
+ }
Host::Ptr parent_host;
Service::Ptr parent_service;
Checkable::Ptr child = dep->GetChild();
- if (!child)
+ if (!child) {
continue;
+ Log(LogDebug, "compat", "Missing child for dependency '" + dep->GetName() + "'.");
+ }
Host::Ptr child_host;
Service::Ptr child_service;
BOOST_FOREACH(const Dependency::Ptr& dep, host->GetDependencies()) {
Checkable::Ptr parent = dep->GetParent();
- if (!parent)
+ if (!parent) {
+ Log(LogDebug, "db_ido", "Missing parent for dependency '" + dep->GetName() + "'.");
continue;
+ }
int state_filter = dep->GetStateFilter();
BOOST_FOREACH(const Dependency::Ptr& dep, service->GetDependencies()) {
Checkable::Ptr parent = dep->GetParent();
- if (!parent)
+ if (!parent) {
+ Log(LogDebug, "db_ido", "Missing parent for dependency '" + dep->GetName() + "'.");
continue;
+ }
Log(LogDebug, "db_ido", "service parents: " + parent->GetName());
if (!host)
return Service::Ptr();
- if (GetParentServiceName().IsEmpty())
+ if (GetParentServiceName().IsEmpty()) {
+ Log(LogDebug, "icinga", "Dependency '" + GetName() + "' parent host '" + GetParentHostName() + ".");
return host;
- else
+ } else {
+ Log(LogDebug, "icinga", "Dependency '" + GetName() + "' parent host '" + GetParentHostName() + "' service '" + GetParentServiceName() + "' .");
return host->GetServiceByShortName(GetParentServiceName());
+ }
}
TimePeriod::Ptr Dependency::GetPeriod(void) const
address = "192.168.1.2",
}
-apply Dependency "5872-switch" to Host {
- child_host_name = "5872-switch"
+apply Dependency "5872-host-switch" to Host {
parent_host_name = "5872-router"
disable_checks = true
assign where host.name == "5872-switch"
}
-apply Dependency "5872-pc" to Host {
- child_host_name = "5872-pc"
+apply Dependency "5872-host-pc" to Host {
parent_host_name = "5872-switch"
disable_checks = true
assign where host.name == "5872-pc"
}
-apply Dependency "5872-server" to Host {
- child_host_name = "5872-server"
+apply Dependency "5872-host-server" to Host {
parent_host_name = "5872-switch"
disable_checks = true
assign where host.name == "5872-server"
}
+apply Dependency "5872-service-switch" to Service {
+ parent_host_name = "5872-router"
+ parent_service_name = "5872-ping4"
+ disable_checks = true
+ assign where host.name == "5872-switch"
+}
+
+apply Dependency "5872-service-pc" to Service {
+ parent_host_name = "5872-switch"
+ parent_service_name = "5872-ping4"
+ disable_checks = true
+ assign where host.name == "5872-pc"
+}
+
+apply Dependency "5872-service-server" to Service {
+ parent_host_name = "5872-switch"
+ parent_service_name = "5872-ping4"
+ states = [ Warning, Critical ]
+ disable_checks = true
+ assign where host.name == "5872-server"
+}