mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 05:34:48 +02:00
IcingaDB: Set downtime cancel_time
conditionally
If the downtime ended automatically `cancel_time` should just be `NULL` instead of a `0` timestamp.
This commit is contained in:
parent
5ea666a7ad
commit
7acec6fc36
@ -2221,7 +2221,6 @@ void IcingaDB::SendRemovedDowntime(const Downtime::Ptr& downtime)
|
||||
"scheduled_end_time", Convert::ToString(TimestampToMilliseconds(downtime->GetEndTime())),
|
||||
"has_been_cancelled", Convert::ToString((unsigned short)downtime->GetWasCancelled()),
|
||||
"trigger_time", Convert::ToString(TimestampToMilliseconds(downtime->GetTriggerTime())),
|
||||
"cancel_time", Convert::ToString(TimestampToMilliseconds(downtime->GetRemoveTime())),
|
||||
"event_id", CalcEventID("downtime_end", downtime),
|
||||
"event_type", "downtime_end"
|
||||
});
|
||||
@ -2241,6 +2240,11 @@ void IcingaDB::SendRemovedDowntime(const Downtime::Ptr& downtime)
|
||||
xAdd.emplace_back(GetObjectIdentifier(triggeredBy));
|
||||
}
|
||||
|
||||
if (downtime->GetWasCancelled()) {
|
||||
xAdd.emplace_back("cancel_time");
|
||||
xAdd.emplace_back(Convert::ToString(TimestampToMilliseconds(downtime->GetRemoveTime())));
|
||||
}
|
||||
|
||||
if (downtime->GetFixed()) {
|
||||
xAdd.emplace_back("start_time");
|
||||
xAdd.emplace_back(Convert::ToString(TimestampToMilliseconds(downtime->GetStartTime())));
|
||||
|
Loading…
x
Reference in New Issue
Block a user