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
|
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
|
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`).
|
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.
|
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_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.
|
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.
|
period |**Optional.** Time period during which this dependency is enabled.
|
||||||
zone |**Optional.** The zone this object is a member of.
|
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.
|
states |**Optional.** A list of state filters when this dependency should be OK. Defaults to [ OK, Warning ] for services and [ Up ] for hosts.
|
||||||
|
|
|
@ -131,11 +131,16 @@ bool Dependency::IsAvailable(DependencyType dt) const
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ignore soft states */
|
if (GetIgnoreSoftStates()) {
|
||||||
if (parent->GetStateType() == StateTypeSoft) {
|
/* 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")
|
Log(LogNotice, "Dependency")
|
||||||
<< "Dependency '" << GetName() << "' passed: " << (service ? "Service" : "Host") << " '" << parent->GetName() << "' is in a soft state.";
|
<< "Dependency '" << GetName() << "' failed: " << (service ? "Service" : "Host") << " '" << parent->GetName() << "' is in a soft state.";
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int state;
|
int state;
|
||||||
|
|
|
@ -44,6 +44,10 @@ class Dependency : CustomVarObject < DependencyNameComposer
|
||||||
[config] Array::Ptr states;
|
[config] Array::Ptr states;
|
||||||
int state_filter_real (StateFilter);
|
int state_filter_real (StateFilter);
|
||||||
|
|
||||||
|
[config] bool ignore_soft_states {
|
||||||
|
default {{{ return true; }}}
|
||||||
|
};
|
||||||
|
|
||||||
[config] bool disable_checks;
|
[config] bool disable_checks;
|
||||||
[config] bool disable_notifications {
|
[config] bool disable_notifications {
|
||||||
default {{{ return true; }}}
|
default {{{ return true; }}}
|
||||||
|
|
Loading…
Reference in New Issue