From b7358334fcb7d399b274ff2200f4067a80ba3b6d Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 23 May 2017 16:13:56 +0200 Subject: [PATCH] Add feature stats to 'icinga' check as performance data metrics --- lib/methods/icingachecktask.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/methods/icingachecktask.cpp b/lib/methods/icingachecktask.cpp index 7e5898936..3a4b668a9 100644 --- a/lib/methods/icingachecktask.cpp +++ b/lib/methods/icingachecktask.cpp @@ -43,7 +43,10 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul if (interval > 60) interval = 60; - Array::Ptr perfdata = new Array(); + /* use feature stats perfdata */ + std::pair feature_stats = CIB::GetFeatureStats(); + + Array::Ptr perfdata = feature_stats.second; perfdata->Add(new PerfdataValue("active_host_checks", CIB::GetActiveHostChecksStatistics(interval) / interval)); perfdata->Add(new PerfdataValue("passive_host_checks", CIB::GetPassiveHostChecksStatistics(interval) / interval));