Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in ranges for ScheduledDowntime is not applied. #5352

Closed
StoneISStephan opened this issue Jun 14, 2017 · 3 comments
Closed

Change in ranges for ScheduledDowntime is not applied. #5352

StoneISStephan opened this issue Jun 14, 2017 · 3 comments
Labels
bug Something isn't working

Comments

@StoneISStephan
Copy link

StoneISStephan commented Jun 14, 2017

icinga2 2.6.3-1ppa1xenial1 r2.6.3-1

When changing the ranges in a Host object the downtimes already scheduled in the database are not adjusted and neither are the new downtime schedules created.

icinga2 object list --name 'hostname.tld!http!update-downtime-service'

Object 'hostname.tld!http!update-downtime-service' of type 'ScheduledDowntime':
% declared in '/etc/icinga2/conf.d/downtime.conf', lines 28:1-28:60

  • __name = "hostname.tld!http!update-downtime-service"
  • author = "icingaadmin"
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 29:2-29:23
  • comment = "Scheduled downtime for System Updates Applied to Services"
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 30:2-30:70
  • duration = 0
  • fixed = true
  • host_name = "hostname.tld"
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 28:1-28:60
  • name = "update-downtime-service"
  • package = "_etc"
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 28:1-28:60
  • ranges
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 32:2-32:42
    • wednesday = "01:00-02:00"
  • service_name = "http"
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 28:1-28:60
  • templates = [ "update-downtime-service" ]
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 28:1-28:60
  • type = "ScheduledDowntime"
  • vars = null
  • zone = "XXX"
    % = modified in '/etc/icinga2/conf.d/downtime.conf', lines 28:1-28:60

After which a systemctl restart icinga2 was issued.

But after 10 minutes the DB still shows the old range (from 04.00 till 05.00):

mysql> SELECT * FROM icinga_scheduleddowntime WHERE name LIKE 'hostname.tld%http%' \G
*************************** 1. row ***************************
scheduleddowntime_id: 3631
instance_id: 1
downtime_type: 1
object_id: 5383
entry_time: 2017-06-14 11:21:16
author_name: icingaadmin
comment_data: Scheduled downtime for System Updates Applied to Services
internal_downtime_id: 10
triggered_by_id: 0
is_fixed: 1
duration: 0
scheduled_start_time: 2017-06-21 04:00:00
scheduled_end_time: 2017-06-21 05:00:00
was_started: 0
actual_start_time: 2017-06-21 04:00:00
actual_start_time_usec: 0
is_in_effect: 0
trigger_time: NULL
name: hostname.tld!http!stone-mon001-1497432076-10
endpoint_object_id: 325
session_token: 1497435587
1 row in set (0.00 sec)

And this remains even hours after changing the config and restarting icinga2.

This ultimately causes us to be unable to update/adjust any previously set ScheduledDowntime's.

The only workaround here is to remove all:

vars.update_downtime = {
	ranges = {
		"wednesday" = "04:00-05:00"
	}

from ALL Host Objects, which is no solution,
and reload/restart Icinga2, which deletes the currently scheduled downtimes.

And afterwards add again:

vars.update_downtime = {
	ranges = {
		"wednesday" = "01:00-03:00"
	}

and reload/restart Icinga 2 again, which creates new scheduled downtimes.

@dnsmichi
Copy link
Contributor

Could be related to #4790.

@dnsmichi dnsmichi added the bug Something isn't working label Jun 20, 2017
@njm506
Copy link

njm506 commented Jun 29, 2017

It's not just the ranges; it looks like nothing gets updated as long as the original configuration object exists. If you change the name or delete the configuration object it gets corrected, though.

@dnsmichi
Copy link
Contributor

Should be fixed with 2.10.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants