mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
IcingaDB::PrepareObject(): convert non-null Checkable#check_timeout to number
and, in case of null, fall back to Checkable#check_command.timeout, just like IcingaDB#SerializeState(). Otherwise the Go daemon crashes. It expects a number.
This commit is contained in:
parent
f0176001fe
commit
766e28e1aa
@ -1272,10 +1272,11 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
|
||||
|
||||
if (type == Host::TypeInstance || type == Service::TypeInstance) {
|
||||
Checkable::Ptr checkable = static_pointer_cast<Checkable>(object);
|
||||
auto checkTimeout (checkable->GetCheckTimeout());
|
||||
|
||||
attributes->Set("checkcommand_name", checkable->GetCheckCommand()->GetName());
|
||||
attributes->Set("max_check_attempts", checkable->GetMaxCheckAttempts());
|
||||
attributes->Set("check_timeout", checkable->GetCheckTimeout());
|
||||
attributes->Set("check_timeout", checkTimeout.IsEmpty() ? checkable->GetCheckCommand()->GetTimeout() : (double)checkTimeout);
|
||||
attributes->Set("check_interval", checkable->GetCheckInterval());
|
||||
attributes->Set("check_retry_interval", checkable->GetRetryInterval());
|
||||
attributes->Set("active_checks_enabled", checkable->GetEnableActiveChecks());
|
||||
|
Loading…
x
Reference in New Issue
Block a user