Canceled Downtimes don't appear in the History

Hello :wave:

Prior to EventhistoryQuery returns never started downtimes events 路 Issue #5020 路 Icinga/icingaweb2 路 GitHub and icinga2web 2.12.0 the fixed downtimes which were canceled after they started were shown in the history.
The icinga2api doesn鈥檛 allow to update downtimes - but it would be really helpful to keep them in the history and to be able to remove them, if they don鈥檛 take as much time as expected to be notified about problems.

One solution i found was to create a new downtime with the current time as the end time鈥 But the icinga2web-history shows the actual_start_time as the start time (So the time the new downtime is created) - which is also kind of confusing.

Do you have any advice how we can end the downtimes 鈥渢he right way鈥, if we can麓t be certain of the exact endtime in advance?

I already created a issue on Github a few days ago: https://github.com/Icinga/icingaweb2/issues/5176

Removing them via API isn鈥檛 a problem.

I use a distinct author if I set one via API so I can later filter by it.

curl -k -s -S -i -u root:icinga -H 'Accept: application/json' \
 -X POST 'https://localhost:5665/v1/actions/remove-downtime' \
 -d $'{
  "type": "Downtime",
  "filter": "host.name == filterHost && !service && downtime.author == filterAuthor",
  "filter_vars": {
    "filterHost": "icinga2-satellite1.localdomain",
    "filterAuthor": "icingaadmin"
  },
  "pretty": true
}'

https://icinga.com/docs/icinga-2/latest/doc/12-icinga2-api/#remove-downtime

Thanks for your response :slight_smile:

But my issue is not with not being able to remove the downtimes via the api - its about using this, the was_cancelled flag gets set in the Database, Which leads to the UI/Icingaweb2 filtering it out of the history:

https://github.com/Icinga/icingaweb2/blob/db9888b1f1380355c68d759b59844e17b0241043/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php#L106

So you want to see downtimes hat were ended before the endtime?

Yes

This used to be the behavior - but it was changed with the latest release.
So maybe there is a better way to end the downtimes, if they dont take as long as expected :slight_smile:

(I just created a PR to kind of revert the change which did that: https://github.com/Icinga/icingaweb2/pull/5184 )

1 Like