mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 16:14:09 +02:00
Update sate sync
fix a crash, possibly two
This commit is contained in:
parent
d8737b238a
commit
9b9cf6d5b0
@ -588,6 +588,7 @@ void RedisWriter::SendStatusUpdate(const ConfigObject::Ptr& object)
|
|||||||
Dictionary::Ptr objectAttrs = SerializeState(object);
|
Dictionary::Ptr objectAttrs = SerializeState(object);
|
||||||
|
|
||||||
std::vector<String> streamadd({"XADD", streamname, "*"});
|
std::vector<String> streamadd({"XADD", streamname, "*"});
|
||||||
|
ObjectLock olock(objectAttrs);
|
||||||
for (const Dictionary::Pair& kv : objectAttrs) {
|
for (const Dictionary::Pair& kv : objectAttrs) {
|
||||||
streamadd.emplace_back(kv.first);
|
streamadd.emplace_back(kv.first);
|
||||||
streamadd.emplace_back(kv.second);
|
streamadd.emplace_back(kv.second);
|
||||||
@ -640,10 +641,12 @@ Dictionary::Ptr RedisWriter::SerializeState(const Object::Ptr& object)
|
|||||||
// TODO: Is it possible there is no last checkresult?
|
// TODO: Is it possible there is no last checkresult?
|
||||||
CheckResult::Ptr cr = checkable->GetLastCheckResult();
|
CheckResult::Ptr cr = checkable->GetLastCheckResult();
|
||||||
|
|
||||||
attrs->Set("output", JsonEncode(cr->GetOutput()));
|
if (cr) {
|
||||||
//attrs->Set("long_output", ) TODO
|
attrs->Set("output", JsonEncode(cr->GetOutput()));
|
||||||
attrs->Set("performance_data", JsonEncode(cr->GetOutput()));
|
//attrs->Set("long_output", ) TODO
|
||||||
attrs->Set("command", JsonEncode(cr->GetCommand()));
|
attrs->Set("performance_data", JsonEncode(cr->GetOutput()));
|
||||||
|
attrs->Set("command", JsonEncode(cr->GetCommand()));
|
||||||
|
}
|
||||||
//attrs->Set("is_problem", !checkable->IsReachable() && !checkable->IsAcknowledged()); TODO
|
//attrs->Set("is_problem", !checkable->IsReachable() && !checkable->IsAcknowledged()); TODO
|
||||||
//attrs->Set("is_handled"); TODO
|
//attrs->Set("is_handled"); TODO
|
||||||
attrs->Set("is_flapping", checkable->IsFlapping());
|
attrs->Set("is_flapping", checkable->IsFlapping());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user