mirror of https://github.com/Icinga/icinga2.git
parent
6b48a36192
commit
6178ca3886
|
@ -176,12 +176,19 @@ void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, const String
|
||||||
|
|
||||||
checkSum->Set("name_checksum", CalculateCheckSumString(object->GetName()));
|
checkSum->Set("name_checksum", CalculateCheckSumString(object->GetName()));
|
||||||
|
|
||||||
if (object->GetReflectionType() == Host::TypeInstance) {
|
// TODO: move this elsewhere
|
||||||
Host::Ptr host = static_pointer_cast<Host>(object);
|
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
|
||||||
checkSum->Set("groups_checksum", CalculateCheckSumGroups(host->GetGroups()));
|
|
||||||
} else if (object->GetReflectionType() == Service::TypeInstance) {
|
if (checkable) {
|
||||||
Service::Ptr service = static_pointer_cast<Service>(object);
|
Host::Ptr host;
|
||||||
|
Service::Ptr service;
|
||||||
|
|
||||||
|
tie(host, service) = GetHostService(checkable);
|
||||||
|
|
||||||
|
if (service)
|
||||||
checkSum->Set("groups_checksum", CalculateCheckSumGroups(service->GetGroups()));
|
checkSum->Set("groups_checksum", CalculateCheckSumGroups(service->GetGroups()));
|
||||||
|
else
|
||||||
|
checkSum->Set("groups_checksum", CalculateCheckSumGroups(host->GetGroups()));
|
||||||
}
|
}
|
||||||
|
|
||||||
String checkSumBody = JsonEncode(checkSum);
|
String checkSumBody = JsonEncode(checkSum);
|
||||||
|
|
Loading…
Reference in New Issue