mirror of https://github.com/Icinga/icinga2.git
parent
9630f15d2f
commit
893f0b9853
|
@ -420,6 +420,7 @@ The following macros provide global statistics:
|
|||
icinga.num_hosts_up | Current number of hosts in state 'Up'.
|
||||
icinga.num_hosts_down | Current number of hosts in state 'Down'.
|
||||
icinga.num_hosts_unreachable | Current number of unreachable hosts.
|
||||
icinga.num_hosts_pending | Current number of pending hosts.
|
||||
icinga.num_hosts_flapping | Current number of flapping hosts.
|
||||
icinga.num_hosts_in_downtime | Current number of hosts in downtime.
|
||||
icinga.num_hosts_acknowledged | Current number of acknowledged host problems.
|
||||
|
|
|
@ -311,6 +311,7 @@ void CIB::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) {
|
|||
|
||||
status->Set("num_hosts_up", hs.hosts_up);
|
||||
status->Set("num_hosts_down", hs.hosts_down);
|
||||
status->Set("num_hosts_pending", hs.hosts_pending);
|
||||
status->Set("num_hosts_unreachable", hs.hosts_unreachable);
|
||||
status->Set("num_hosts_flapping", hs.hosts_flapping);
|
||||
status->Set("num_hosts_in_downtime", hs.hosts_in_downtime);
|
||||
|
|
|
@ -278,6 +278,9 @@ bool IcingaApplication::ResolveMacro(const String& macro, const CheckResult::Ptr
|
|||
} else if (macro == "num_hosts_down") {
|
||||
*result = Convert::ToString(hs.hosts_down);
|
||||
return true;
|
||||
} else if (macro == "num_hosts_pending") {
|
||||
*result = Convert::ToString(hs.hosts_pending);
|
||||
return true;
|
||||
} else if (macro == "num_hosts_unreachable") {
|
||||
*result = Convert::ToString(hs.hosts_unreachable);
|
||||
return true;
|
||||
|
|
|
@ -91,6 +91,7 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul
|
|||
|
||||
perfdata->Add(new PerfdataValue("num_hosts_up", hs.hosts_up));
|
||||
perfdata->Add(new PerfdataValue("num_hosts_down", hs.hosts_down));
|
||||
perfdata->Add(new PerfdataValue("num_hosts_pending", hs.hosts_pending));
|
||||
perfdata->Add(new PerfdataValue("num_hosts_unreachable", hs.hosts_unreachable));
|
||||
perfdata->Add(new PerfdataValue("num_hosts_flapping", hs.hosts_flapping));
|
||||
perfdata->Add(new PerfdataValue("num_hosts_in_downtime", hs.hosts_in_downtime));
|
||||
|
|
Loading…
Reference in New Issue