mirror of https://github.com/Icinga/icinga2.git
parent
4e27ded7ce
commit
aac53c1dd1
|
@ -1418,6 +1418,9 @@ You can control that option by defining the `disable_notifications` attribute.
|
|||
|
||||
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`).
|
||||
|
||||
|
|
|
@ -686,6 +686,7 @@ Configuration Attributes:
|
|||
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.
|
||||
|
|
|
@ -131,12 +131,17 @@ bool Dependency::IsAvailable(DependencyType dt) const
|
|||
return true;
|
||||
}
|
||||
|
||||
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() << "' failed: " << (service ? "Service" : "Host") << " '" << parent->GetName() << "' is in a soft state.";
|
||||
}
|
||||
|
||||
int state;
|
||||
|
||||
|
|
|
@ -44,6 +44,10 @@ class Dependency : CustomVarObject < DependencyNameComposer
|
|||
[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; }}}
|
||||
|
|
Loading…
Reference in New Issue