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

This commit is contained in:
Michael Friedrich 2017-05-23 16:13:56 +02:00
parent cbec910521
commit b7358334fc
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));