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

[dev.icinga.com #11919] Duplicating downtime from ScheduledDowntime object on each restart #4272

Closed
icinga-migration opened this issue Jun 9, 2016 · 6 comments · Fixed by #6359
Labels
area/configuration DSL, parser, compiler, error handling area/distributed Distributed monitoring (master, satellites, clients) bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11919

Created by ljm on 2016-06-09 11:12:30 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-11-09 14:58:53 +00:00 (in Redmine)

Icinga Version: 2.4.10
Backport?: Not yet backported
Include in Changelog: 1

Summary: on each restart, nearest occurence of scheduled downtime is replicated - it is shown multiple times in webinterface and new file in /var/lib/icinga2/api/packages/_api/conf.d/downtimes/ is created.

Configuration:

object ScheduledDowntime "DRDB Downtime" {
author = "system"
host_name = "pl-waw04a-xen21-db01"
service_name = "DRDB status"
comment = "Automatic downtime - database not ready"
ranges = {
"monday" = "00:00-02:00"
"tuesday" = "00:00-02:00"
"wednesday" = "00:00-02:00"
"thursday" = "00:00-02:00"
"friday" = "00:00-02:00"
"saturday" = "00:00-02:00"
"sunday" = "00:00-02:00"
}
}

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-07-28 16:17:00 +00:00

  • Parent Id set to 11312

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-11-09 14:58:53 +00:00

  • Parent Id deleted 11312

@icinga-migration icinga-migration added bug Something isn't working area/configuration DSL, parser, compiler, error handling labels Jan 17, 2017
@Mikesch-mp
Copy link
Contributor

Mikesch-mp commented Oct 12, 2017

I had the same problem in a HA Master setup. What stopped this was to comment out the recursive import of /etc/icinga2/conf.d on all masters, satellites and agents. Also i disabled accpet_config on Master1.
What still exist is that every scheduleddowntime is shown twice in icingaweb2, because of 2 entries per scheduleddowntime in the ido db.

IDO:

MariaDB [idodb]> select scheduleddowntime_id,instance_id,object_id,internal_downtime_id,endpoint_object_id,name from icinga_scheduleddowntime where name like 'agent01%' order by name;
+----------------------+-------------+-----------+----------------------+--------------------+-------------------------------------------------------+
| scheduleddowntime_id | instance_id | object_id | internal_downtime_id | endpoint_object_id | name                                                  |
+----------------------+-------------+-----------+----------------------+--------------------+-------------------------------------------------------+
|            260928645 |           4 |     26322 |                 5344 |                601 | agent01!master1-1507290633-4802                   |
|            260916840 |           4 |     26322 |                 5345 |                601 | agent01!master2-1507290644-4463                   |
|            260921700 |           4 |     78167 |                 5335 |                601 | agent01!SN-agent-health!master1-1507290613-2493   |
|            260910864 |           4 |     78167 |                 5336 |                601 | agent01!SN-agent-health!master2-1507290630-2509   |
|            260921841 |           4 |     95927 |                 5337 |                601 | agent01!SN-dns!master1-1507290613-2517            |
|            260910642 |           4 |     95927 |                 5338 |                601 | agent01!SN-dns!master2-1507290630-2439            |
|            260921619 |           4 |     27552 |                 5339 |                601 | agent01!SN-ping!master1-1507290613-2437           |
|            260911029 |           4 |     27552 |                 5340 |                601 | agent01!SN-ping!master2-1507290630-2579           |
|            260921796 |           4 |     27456 |                 5341 |                601 | agent01!SN-service-icinga!master1-1507290613-2526 |
|            260910654 |           4 |     27456 |                 5343 |                601 | agent01!SN-service-icinga!master2-1507290630-2452 |
|            260921979 |           4 |     27453 |                 5319 |                601 | agent01!SN-WIN-disk-C!master1-1507290614-2569     |
|            260910843 |           4 |     27453 |                 5320 |                601 | agent01!SN-WIN-disk-C!master2-1507290630-2515     |
|            260922735 |           4 |     27459 |                 5321 |                601 | agent01!SN-WIN-disk-non_C!master1-1507290615-2817 |
|            260910555 |           4 |     27459 |                 5322 |                601 | agent01!SN-WIN-disk-non_C!master2-1507290629-2405 |
|            260921562 |           4 |     27471 |                 5323 |                601 | agent01!SN-WIN-load!master1-1507290613-2423       |
|            260910879 |           4 |     27471 |                 5324 |                601 | agent01!SN-WIN-load!master2-1507290630-2530       |
|            260921787 |           4 |     27477 |                 5325 |                601 | agent01!SN-WIN-memory!master1-1507290613-2519     |
|            260910981 |           4 |     27477 |                 5326 |                601 | agent01!SN-WIN-memory!master2-1507290630-2539     |
|            260922705 |           4 |     27498 |                 5327 |                601 | agent01!SN-WIN-network!master1-1507290615-2827    |
|            260910885 |           4 |     27498 |                 5328 |                601 | agent01!SN-WIN-network!master2-1507290630-2542    |
|            260921664 |           4 |     27507 |                 5329 |                601 | agent01!SN-WIN-procs!master1-1507290613-2481      |
|            260910603 |           4 |     27507 |                 5330 |                601 | agent01!SN-WIN-procs!master2-1507290629-2426      |
|            260921835 |           4 |     27522 |                 5331 |                601 | agent01!SN-WIN-swap!master1-1507290613-2516       |
|            260910990 |           4 |     27522 |                 5332 |                601 | agent01!SN-WIN-swap!master2-1507290630-2554       |
|            260921694 |           4 |     27549 |                 5333 |                601 | agent01!SN-WIN-uptime!master1-1507290613-2482     |
|            260909631 |           4 |     27549 |                 5334 |                601 | agent01!SN-WIN-uptime!master2-1507290627-2131     |
+----------------------+-------------+-----------+----------------------+--------------------+-------------------------------------------------------+

API Master1

Master1:~ # icinga2 object list --type scheduleddowntime --name 'agent01!D-PROD-HOST*'
Object 'agent01!D-PROD-HOST-each_3rd_thuesday-2100_0200' of type 'ScheduledDowntime':
  % declared in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * __name = "agent01!D-PROD-HOST-each_3rd_thuesday-2100_0200"
  * author = "hein@bloe.de"
    % = modified in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 4:3-4:32
  * comment = "PROD-Wartungsfenster (Jeden 3ten Dienstag 21:00-02:00)"
    % = modified in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 5:3-5:73
  * duration = 0
  * fixed = true
  * host_name = "agent01"
    % = modified in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * name = "D-PROD-HOST-each_3rd_thuesday-2100_0200"
  * package = "_etc"
    % = modified in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * ranges
    % = modified in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 6:3-8:3
    * tuesday 3 = "21:00-26:00"
  * service_name = ""
  * source_location
    * first_column = 1
    * first_line = 3
    * last_column = 78
    * last_line = 3
    * path = "/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf"
  * templates = [ "D-PROD-HOST-each_3rd_thuesday-2100_0200" ]
    % = modified in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * type = "ScheduledDowntime"
  * vars = null
  * zone = "PROD"
    % = modified in '/etc/icinga2/zones.d/MASTER/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78

Master2

Master2:~ # icinga2 object list --type scheduleddowntime --name 'agent01!D-PROD-HOST*'

Object 'agent01!D-PROD-HOST-each_3rd_thuesday-2100_0200' of type 'ScheduledDowntime':
  % declared in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * __name = "agent01!D-PROD-HOST-each_3rd_thuesday-2100_0200"
  * author = "hein@bloe.de"
    % = modified in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 4:3-4:32
  * comment = "PROD-Wartungsfenster (Jeden 3ten Dienstag 21:00-02:00)"
    % = modified in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 5:3-5:73
  * duration = 0
  * fixed = true
  * host_name = "agent01"
    % = modified in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * name = "D-PROD-HOST-each_3rd_thuesday-2100_0200"
  * package = "_cluster"
    % = modified in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * ranges
    % = modified in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 6:3-8:3
    * tuesday 3 = "21:00-26:00"
  * service_name = ""
  * source_location
    * first_column = 1
    * first_line = 3
    * last_column = 78
    * last_line = 3
    * path = "/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf"
  * templates = [ "D-PROD-HOST-each_3rd_thuesday-2100_0200" ]
    % = modified in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78
  * type = "ScheduledDowntime"
  * vars = null
  * zone = "PROD"
    % = modified in '/var/lib/icinga2/api/zones/MASTER/_etc/downtimes/D-PROD-HOST-each_3rd_thuesday-2100_0400.conf', lines 3:1-3:78

Config:

apply ScheduledDowntime "D-PROD-HOST-each_3rd_thuesday-2100_0200" to Host {
  author = "hein@bloe.de"
  comment = "PROD-Wartungsfenster (Jeden 3ten Dienstag 21:00-02:00)"
  ranges = {
    "tuesday 3" = "21:00-26:00"
  }

  assign where ( (host.vars.rz == "Links") && (host.vars.environment == "PROD") )

}

@dnsmichi
Copy link
Contributor

img_0447

@dnsmichi dnsmichi added the area/distributed Distributed monitoring (master, satellites, clients) label Apr 25, 2018
@dnsmichi dnsmichi changed the title [dev.icinga.com #11919] Duplicating downtime each restart [dev.icinga.com #11919] Duplicating downtime from ScheduledDowntime object on each restart May 4, 2018
@dnsmichi dnsmichi added this to the 2.9.0 milestone Jun 4, 2018
@dnsmichi
Copy link
Contributor

dnsmichi commented Jun 4, 2018

Reproducing the problem is scheduled for CW24.

@Crunsher
Copy link
Contributor

Crunsher commented Jun 7, 2018

What I tried:

  • HA master zone (two endpoints, both with accept config)
  • One agent with the master as parent (accepts config)
  • Time on agent set two a few days in the past
  • downtime in global-zone applying to all

But I was unable to reproduce this with this setup
It's working after a few restarts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling area/distributed Distributed monitoring (master, satellites, clients) bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants