mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 20:24:33 +02:00
parent
2d6c3e8d5b
commit
29ad90a469
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "icinga/apievents.hpp"
|
#include "icinga/apievents.hpp"
|
||||||
#include "icinga/service.hpp"
|
#include "icinga/service.hpp"
|
||||||
|
#include "icinga/perfdatavalue.hpp"
|
||||||
#include "remote/apilistener.hpp"
|
#include "remote/apilistener.hpp"
|
||||||
#include "remote/endpoint.hpp"
|
#include "remote/endpoint.hpp"
|
||||||
#include "remote/messageorigin.hpp"
|
#include "remote/messageorigin.hpp"
|
||||||
@ -134,8 +135,29 @@ Value ApiEvents::CheckResultAPIHandler(const MessageOrigin& origin, const Dictio
|
|||||||
return Empty;
|
return Empty;
|
||||||
|
|
||||||
CheckResult::Ptr cr = make_shared<CheckResult>();
|
CheckResult::Ptr cr = make_shared<CheckResult>();
|
||||||
|
|
||||||
|
Dictionary::Ptr vcr = params->Get("cr");
|
||||||
|
Array::Ptr vperf = vcr->Get("performance_data");
|
||||||
|
vcr->Remove("performance_data");
|
||||||
|
|
||||||
Deserialize(cr, params->Get("cr"), true);
|
Deserialize(cr, params->Get("cr"), true);
|
||||||
|
|
||||||
|
Array::Ptr rperf = make_shared<Array>();
|
||||||
|
|
||||||
|
ObjectLock olock(vperf);
|
||||||
|
BOOST_FOREACH(const Value& vp, vperf) {
|
||||||
|
Value p;
|
||||||
|
|
||||||
|
if (vp.IsObjectType<Dictionary>()) {
|
||||||
|
PerfdataValue::Ptr val = make_shared<PerfdataValue>();
|
||||||
|
Deserialize(val, vp, true);
|
||||||
|
rperf->Add(val);
|
||||||
|
} else
|
||||||
|
rperf->Add(vp);
|
||||||
|
}
|
||||||
|
|
||||||
|
cr->SetPerformanceData(rperf);
|
||||||
|
|
||||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||||
|
|
||||||
if (!host)
|
if (!host)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user