disable_notifications = false
+If the dependency should be triggered in the parent object's soft state, you
+need to set `ignore_soft_states` to `false`.
+
The dependency state filter must be defined based on the parent object being
either a host (`Up`, `Down`) or a service (`OK`, `Warning`, `Critical`, `Unknown`).
child_service_name |**Optional.** The child service. If omitted this dependency object is treated as host dependency.
disable_checks |**Optional.** Whether to disable checks when this dependency fails. Defaults to false.
disable_notifications |**Optional.** Whether to disable notifications when this dependency fails. Defaults to true.
+ ignore_soft_states |**Optional.** Whether to ignore soft states for the reachability calculation. Defaults to true.
period |**Optional.** Time period during which this dependency is enabled.
zone |**Optional.** The zone this object is a member of.
states |**Optional.** A list of state filters when this dependency should be OK. Defaults to [ OK, Warning ] for services and [ Up ] for hosts.
return true;
}
- /* ignore soft states */
- if (parent->GetStateType() == StateTypeSoft) {
+ if (GetIgnoreSoftStates()) {
+ /* ignore soft states */
+ if (parent->GetStateType() == StateTypeSoft) {
+ Log(LogNotice, "Dependency")
+ << "Dependency '" << GetName() << "' passed: " << (service ? "Service" : "Host") << " '" << parent->GetName() << "' is in a soft state.";
+ return true;
+ }
+ } else {
Log(LogNotice, "Dependency")
- << "Dependency '" << GetName() << "' passed: " << (service ? "Service" : "Host") << " '" << parent->GetName() << "' is in a soft state.";
- return true;
+ << "Dependency '" << GetName() << "' failed: " << (service ? "Service" : "Host") << " '" << parent->GetName() << "' is in a soft state.";
}
int state;
[config] Array::Ptr states;
int state_filter_real (StateFilter);
+ [config] bool ignore_soft_states {
+ default {{{ return true; }}}
+ };
+
[config] bool disable_checks;
[config] bool disable_notifications {
default {{{ return true; }}}