]> granicus.if.org Git - icinga2/commitdiff
Fix missing num_hosts_pending in /v1/status/CIB
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 26 Nov 2015 19:03:46 +0000 (20:03 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Tue, 8 Dec 2015 14:45:22 +0000 (15:45 +0100)
fixes #10736

doc/3-monitoring-basics.md
lib/icinga/cib.cpp
lib/icinga/icingaapplication.cpp
lib/methods/icingachecktask.cpp

index a39a8215f16e75e11bd35b1eb1af6c7315474d76..ff884d0e4cd840ffcbbf9d5ebfccca71e59fa486 100644 (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_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.
index af9c8bf05c4ff872df956fb1c2b7e8c538f4f418..c8c285a9434f15b7dc01af051f20a62e5be1204e 100644 (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_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);
index 36543e725c6fdc22825ac512388ed87a96f32c8a..498073f03c0990b02c3587857442a42dcc85bc74 100644 (file)
@@ -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;
index fef332c0ce0321f57c799b9c69f4357f2a845a3d..ccb4c32544fd04f3ac5cda91033937197aa09902 100644 (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_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));