From 19226ae55c2880662eece272d9c0f772c8fd08dc Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 27 Jul 2023 17:00:24 +0200 Subject: [PATCH] cmd/icingadb-migrate: ignore icinga_downtimehistory#was_started=0 rows Such appear e.g. for scheduled but never triggered flexible Downtimes. Not triggered = no events. --- cmd/icingadb-migrate/convert.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/icingadb-migrate/convert.go b/cmd/icingadb-migrate/convert.go index 965077e56..133362ab0 100644 --- a/cmd/icingadb-migrate/convert.go +++ b/cmd/icingadb-migrate/convert.go @@ -220,6 +220,7 @@ type downtimeRow = struct { Duration int64 ScheduledStartTime int64 ScheduledEndTime int64 + WasStarted uint8 ActualStartTime int64 ActualStartTimeUsec uint32 ActualEndTime int64 @@ -242,6 +243,10 @@ func convertDowntimeRows( for _, row := range idoRows { checkpoint = row.DowntimehistoryId + if row.WasStarted == 0 { + continue + } + id := calcObjectId(env, row.Name) typ := objectTypes[row.ObjecttypeId] hostId := calcObjectId(env, row.Name1)