Merge pull request #5284 from Icinga/feature/add-feature-metrics-icinga-check

Add feature stats to 'icinga' check as performance data metrics

refs #5133
This commit is contained in:
Michael Friedrich 2017-05-23 17:32:39 +02:00 committed by GitHub
commit 3d92d69290
1 changed files with 4 additions and 1 deletions

View File

@ -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<Dictionary::Ptr, Array::Ptr> 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));