Fix missing num_hosts_pending in /v1/status/CIB

fixes #10736
This commit is contained in:
Michael Friedrich 2015-11-26 20:03:46 +01:00
parent ef0f4ca4b4
commit 737c574cdf
4 changed files with 6 additions and 0 deletions

View File

@ -420,6 +420,7 @@ The following macros provide global statistics:
icinga.num_hosts_up | Current number of hosts in state 'Up'. 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_down | Current number of hosts in state 'Down'.
icinga.num_hosts_unreachable | Current number of unreachable hosts. 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_flapping | Current number of flapping hosts.
icinga.num_hosts_in_downtime | Current number of hosts in downtime. icinga.num_hosts_in_downtime | Current number of hosts in downtime.
icinga.num_hosts_acknowledged | Current number of acknowledged host problems. icinga.num_hosts_acknowledged | Current number of acknowledged host problems.

View File

@ -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_up", hs.hosts_up);
status->Set("num_hosts_down", hs.hosts_down); 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_unreachable", hs.hosts_unreachable);
status->Set("num_hosts_flapping", hs.hosts_flapping); status->Set("num_hosts_flapping", hs.hosts_flapping);
status->Set("num_hosts_in_downtime", hs.hosts_in_downtime); status->Set("num_hosts_in_downtime", hs.hosts_in_downtime);

View File

@ -278,6 +278,9 @@ bool IcingaApplication::ResolveMacro(const String& macro, const CheckResult::Ptr
} else if (macro == "num_hosts_down") { } else if (macro == "num_hosts_down") {
*result = Convert::ToString(hs.hosts_down); *result = Convert::ToString(hs.hosts_down);
return true; return true;
} else if (macro == "num_hosts_pending") {
*result = Convert::ToString(hs.hosts_pending);
return true;
} else if (macro == "num_hosts_unreachable") { } else if (macro == "num_hosts_unreachable") {
*result = Convert::ToString(hs.hosts_unreachable); *result = Convert::ToString(hs.hosts_unreachable);
return true; return true;

View File

@ -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_up", hs.hosts_up));
perfdata->Add(new PerfdataValue("num_hosts_down", hs.hosts_down)); 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_unreachable", hs.hosts_unreachable));
perfdata->Add(new PerfdataValue("num_hosts_flapping", hs.hosts_flapping)); perfdata->Add(new PerfdataValue("num_hosts_flapping", hs.hosts_flapping));
perfdata->Add(new PerfdataValue("num_hosts_in_downtime", hs.hosts_in_downtime)); perfdata->Add(new PerfdataValue("num_hosts_in_downtime", hs.hosts_in_downtime));