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

Icinga Timeperiod exclusion exceeded to next day #8741

Open
cmenapace opened this issue Apr 27, 2021 · 13 comments · May be fixed by #9983
Open

Icinga Timeperiod exclusion exceeded to next day #8741

cmenapace opened this issue Apr 27, 2021 · 13 comments · May be fixed by #9983
Assignees
Labels
bug Something isn't working ref/IP
Milestone

Comments

@cmenapace
Copy link

Describe the bug

We have an unexpected behavior with tiemperiods exclusion. When it comes to a day in the exclusion timeperiod, the exclusion effects also the next day

To Reproduce

This is ouer Icinga Holiday/exclusion timeperiod

object TimePeriod "Feiertage" {
  import "legacy-timeperiod"
  display_name = "Gesetzliche Feiertage; keine Meldungen"
  ranges = {
    "january 1"   = "00:00-24:00"               //Neujahr
    "january 6"   = "00:00-24:00"               //Heilige Drei Könige
    "april 25"    = "00:00-24:00"               //Tag der Befreiung Italiens
    "april 5"     = "00:00-24:00"               //Ostern
    "may 1"       = "00:00-24:00"               //Tag der arbeiter
    "june 2"      = "00:00-24:00"               //Tag der Republik Italien
    "august 15"   = "00:00-24:00"               //Ferragosto
    "november 1"  = "00:00-24:00"               //Allerheiligen
    "december 8"  = "00:00-24:00"               //Maria Empfängnis
    "december 25" = "00:00-24:00"               //Weihnachten
    "december 26" = "00:00-24:00"               //Stephanstag
  }

this timeperiod are excluded in ouer work day timeperiod

object TimePeriod "7to5" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 7to5 TimePeriod"

  excludes = [ "Feiertage" ]

  ranges = {
    "monday"    = "07:00-17:00"
    "tuesday"   = "07:00-17:00"
    "wednesday" = "07:00-17:00"
    "thursday"  = "07:00-17:00"
    "friday"    = "07:00-17:00"
  }
}

if it comes to a day, in ouer exclusion timeperiod, for exemple the 25 april, the timeperiod 7to5 remains inactive, also for the 26 april the whole day. Except if I restart the Icinga service.

Here is the output of the timeperiods status, retrived with the Icinga REST API

https://localhost:5665/v1/objects/timeperiods

{
  "results": [
    {
      "attrs": {
        "__name": "7to22",
        "active": true,
        "display_name": "Icinga 2 7to22 TimePeriod",
        "excludes": [
          "Feiertage"
        ],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "7to22",
        "original_attributes": null,
        "package": "director",
        "paused": false,
        "prefer_includes": true,
        "ranges": {
          "friday": "07:00-22:00",
          "monday": "07:00-22:00",
          "thursday": "07:00-22:00",
          "tuesday": "07:00-22:00",
          "wednesday": "07:00-22:00"
        },
        "segments": [
          {
            "begin": 1619499600,
            "end": 1619553600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 65,
          "last_column": 25,
          "last_line": 65,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "7to22",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619553600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "7to22",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "7to5",
        "active": true,
        "display_name": "Icinga 2 7to5 TimePeriod",
        "excludes": [
          "Feiertage"
        ],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "7to5",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "07:00-17:00",
          "monday": "07:00-17:00",
          "thursday": "07:00-17:00",
          "tuesday": "07:00-17:00",
          "wednesday": "07:00-17:00"
        },
        "segments": [
          {
            "begin": 1619499600,
            "end": 1619535600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 39,
          "last_column": 24,
          "last_line": 39,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "7to5",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619535600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "7to5",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "TABS-Bereitschaft",
        "active": true,
        "display_name": "TABS-Bereitschaft TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "TABS-Bereitschaft",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "17:00-22:00",
          "monday": "17:00-22:00",
          "thursday": "17:00-22:00",
          "tuesday": "17:00-22:00",
          "wednesday": "17:00-22:00"
        },
        "segments": [
          {
            "begin": 1619449200,
            "end": 1619467200
          },
          {
            "begin": 1619535600,
            "end": 1619553600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 97,
          "last_column": 37,
          "last_line": 97,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "TABS-Bereitschaft",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619553600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "TABS-Bereitschaft",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "never",
        "active": true,
        "display_name": "Icinga 2 never TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "never",
        "original_attributes": null,
        "package": "director",
        "paused": false,
        "prefer_includes": true,
        "ranges": {},
        "segments": [],
        "source_location": {
          "first_column": 1,
          "first_line": 110,
          "last_column": 25,
          "last_line": 110,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "never",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619528079.284048,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "never",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "6to22",
        "active": true,
        "display_name": "Icinga 2 6to22 TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": true,
        "name": "6to22",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "06:00-22:00",
          "monday": "06:00-22:00",
          "saturday": "07:00-22:00",
          "sunday": "07:00-22:00",
          "thursday": "06:00-22:00",
          "tuesday": "06:00-22:00",
          "wednesday": "06:00-22:00"
        },
        "segments": [
          {
            "begin": 1619409600,
            "end": 1619467200
          },
          {
            "begin": 1619496000,
            "end": 1619553600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 81,
          "last_column": 25,
          "last_line": 81,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "6to22",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619553600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "6to22",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "Feiertage",
        "active": true,
        "display_name": "Gesetzliche Feiertage; keine Meldungen",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "Feiertage",
        "original_attributes": null,
        "package": "director",
        "paused": false,
        "prefer_includes": true,
        "ranges": {
          "april 25": "00:00-24:00",
          "april 5": "00:00-24:00",
          "august 15": "00:00-24:00",
          "december 25": "00:00-24:00",
          "december 26": "00:00-24:00",
          "december 8": "00:00-24:00",
          "january 1": "00:00-24:00",
          "january 6": "00:00-24:00",
          "june 2": "00:00-24:00",
          "may 1": "00:00-24:00",
          "november 1": "00:00-24:00"
        },
        "segments": [],
        "source_location": {
          "first_column": 1,
          "first_line": 118,
          "last_column": 29,
          "last_line": 118,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "Feiertage",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619528079.284048,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "Feiertage",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "24x7",
        "active": true,
        "display_name": "Icinga 2 24x7 TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": true,
        "name": "24x7",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "00:00-24:00",
          "monday": "00:00-24:00",
          "saturday": "00:00-24:00",
          "sunday": "00:00-24:00",
          "thursday": "00:00-24:00",
          "tuesday": "00:00-24:00",
          "wednesday": "00:00-24:00"
        },
        "segments": [
          {
            "begin": 1619388000,
            "end": 1619560800
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 8,
          "last_column": 24,
          "last_line": 8,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "24x7",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619560800,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "24x7",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "non-wrk-houers",
        "active": true,
        "display_name": "Icinga 2 Non Work Houers TimePeriod",
        "excludes": [
          "7to5"
        ],
        "ha_mode": 0,
        "includes": [
          "24x7"
        ],
        "is_inside": true,
        "name": "non-wrk-houers",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": false,
        "ranges": null,
        "segments": [
          {
            "begin": 1619388000,
            "end": 1619499600
          },
          {
            "begin": 1619535600,
            "end": 1619560800
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 55,
          "last_column": 34,
          "last_line": 55,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "non-wrk-houers",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619560800,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "non-wrk-houers",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "9to5",
        "active": true,
        "display_name": "Icinga 2 9to5 TimePeriod",
        "excludes": [
          "Feiertage"
        ],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "9to5",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "09:00-17:00",
          "monday": "09:00-17:00",
          "thursday": "09:00-17:00",
          "tuesday": "09:00-17:00",
          "wednesday": "09:00-17:00"
        },
        "segments": [
          {
            "begin": 1619506800,
            "end": 1619535600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 23,
          "last_column": 24,
          "last_line": 23,
          "path": "/var/lib/icinga2/api/packages/director/976217a9-344b-4408-b31a-ba7b054e0f90/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "9to5",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438079.284048,
        "valid_end": 1619535600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "9to5",
      "type": "TimePeriod"
    }
  ]
}

Here we can see, that for the timeperiod 7to5 is_inside": false"

After the restart of the Icinga service, the 7to5 returns to is_inside": true"

{
  "results": [
    {
      "attrs": {
        "__name": "TABS-Bereitschaft",
        "active": true,
        "display_name": "TABS-Bereitschaft TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "TABS-Bereitschaft",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "17:00-22:00",
          "monday": "17:00-22:00",
          "thursday": "17:00-22:00",
          "tuesday": "17:00-22:00",
          "wednesday": "17:00-22:00"
        },
        "segments": [
          {
            "begin": 1619449200,
            "end": 1619467200
          },
          {
            "begin": 1619535600,
            "end": 1619553600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 97,
          "last_column": 37,
          "last_line": 97,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "TABS-Bereitschaft",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438679.288072,
        "valid_end": 1619553600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "TABS-Bereitschaft",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "7to5",
        "active": true,
        "display_name": "Icinga 2 7to5 TimePeriod",
        "excludes": [
          "Feiertage"
        ],
        "ha_mode": 0,
        "includes": [],
        "is_inside": true,
        "name": "7to5",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "07:00-17:00",
          "monday": "07:00-17:00",
          "thursday": "07:00-17:00",
          "tuesday": "07:00-17:00",
          "wednesday": "07:00-17:00"
        },
        "segments": [
          {
            "begin": 1619413200,
            "end": 1619449200
          },
          {
            "begin": 1619499600,
            "end": 1619535600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 39,
          "last_column": 24,
          "last_line": 39,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "7to5",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619413200,
        "valid_end": 1619535600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "7to5",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "7to22",
        "active": true,
        "display_name": "Icinga 2 7to22 TimePeriod",
        "excludes": [
          "Feiertage"
        ],
        "ha_mode": 0,
        "includes": [],
        "is_inside": true,
        "name": "7to22",
        "original_attributes": null,
        "package": "director",
        "paused": false,
        "prefer_includes": true,
        "ranges": {
          "friday": "07:00-22:00",
          "monday": "07:00-22:00",
          "thursday": "07:00-22:00",
          "tuesday": "07:00-22:00",
          "wednesday": "07:00-22:00"
        },
        "segments": [
          {
            "begin": 1619413200,
            "end": 1619467200
          },
          {
            "begin": 1619499600,
            "end": 1619553600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 65,
          "last_column": 25,
          "last_line": 65,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "7to22",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619413200,
        "valid_end": 1619553600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "7to22",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "never",
        "active": true,
        "display_name": "Icinga 2 never TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "never",
        "original_attributes": null,
        "package": "director",
        "paused": false,
        "prefer_includes": true,
        "ranges": {},
        "segments": [],
        "source_location": {
          "first_column": 1,
          "first_line": 110,
          "last_column": 25,
          "last_line": 110,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "never",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438679.288072,
        "valid_end": 1619528706.79531,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "never",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "24x7",
        "active": true,
        "display_name": "Icinga 2 24x7 TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": true,
        "name": "24x7",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "00:00-24:00",
          "monday": "00:00-24:00",
          "saturday": "00:00-24:00",
          "sunday": "00:00-24:00",
          "thursday": "00:00-24:00",
          "tuesday": "00:00-24:00",
          "wednesday": "00:00-24:00"
        },
        "segments": [
          {
            "begin": 1619388000,
            "end": 1619560800
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 8,
          "last_column": 24,
          "last_line": 8,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "24x7",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619388000,
        "valid_end": 1619560800,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "24x7",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "non-wrk-houers",
        "active": true,
        "display_name": "Icinga 2 Non Work Houers TimePeriod",
        "excludes": [
          "7to5"
        ],
        "ha_mode": 0,
        "includes": [
          "24x7"
        ],
        "is_inside": false,
        "name": "non-wrk-houers",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": false,
        "ranges": null,
        "segments": [
          {
            "begin": 1619388000,
            "end": 1619413200
          },
          {
            "begin": 1619449200,
            "end": 1619499600
          },
          {
            "begin": 1619535600,
            "end": 1619560800
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 55,
          "last_column": 34,
          "last_line": 55,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "non-wrk-houers",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619388000,
        "valid_end": 1619560800,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "non-wrk-houers",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "6to22",
        "active": true,
        "display_name": "Icinga 2 6to22 TimePeriod",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": true,
        "name": "6to22",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "06:00-22:00",
          "monday": "06:00-22:00",
          "saturday": "07:00-22:00",
          "sunday": "07:00-22:00",
          "thursday": "06:00-22:00",
          "tuesday": "06:00-22:00",
          "wednesday": "06:00-22:00"
        },
        "segments": [
          {
            "begin": 1619409600,
            "end": 1619467200
          },
          {
            "begin": 1619496000,
            "end": 1619553600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 81,
          "last_column": 25,
          "last_line": 81,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "6to22",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619409600,
        "valid_end": 1619553600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "6to22",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "9to5",
        "active": true,
        "display_name": "Icinga 2 9to5 TimePeriod",
        "excludes": [
          "Feiertage"
        ],
        "ha_mode": 0,
        "includes": [],
        "is_inside": true,
        "name": "9to5",
        "original_attributes": null,
        "package": "director",
        "paused": true,
        "prefer_includes": true,
        "ranges": {
          "friday": "09:00-17:00",
          "monday": "09:00-17:00",
          "thursday": "09:00-17:00",
          "tuesday": "09:00-17:00",
          "wednesday": "09:00-17:00"
        },
        "segments": [
          {
            "begin": 1619420400,
            "end": 1619449200
          },
          {
            "begin": 1619506800,
            "end": 1619535600
          }
        ],
        "source_location": {
          "first_column": 1,
          "first_line": 23,
          "last_column": 24,
          "last_line": 23,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "9to5",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619420400,
        "valid_end": 1619535600,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "9to5",
      "type": "TimePeriod"
    },
    {
      "attrs": {
        "__name": "Feiertage",
        "active": true,
        "display_name": "Gesetzliche Feiertage; keine Meldungen",
        "excludes": [],
        "ha_mode": 0,
        "includes": [],
        "is_inside": false,
        "name": "Feiertage",
        "original_attributes": null,
        "package": "director",
        "paused": false,
        "prefer_includes": true,
        "ranges": {
          "april 25": "00:00-24:00",
          "april 5": "00:00-24:00",
          "august 15": "00:00-24:00",
          "december 25": "00:00-24:00",
          "december 26": "00:00-24:00",
          "december 8": "00:00-24:00",
          "january 1": "00:00-24:00",
          "january 6": "00:00-24:00",
          "june 2": "00:00-24:00",
          "may 1": "00:00-24:00",
          "november 1": "00:00-24:00"
        },
        "segments": [],
        "source_location": {
          "first_column": 1,
          "first_line": 118,
          "last_column": 29,
          "last_line": 118,
          "path": "/var/lib/icinga2/api/packages/director/9aff8467-3c4e-4d7b-8737-21f553e9b553/zones.d/ris-global/custom-objects/templates/timeperiods.conf"
        },
        "templates": [
          "Feiertage",
          "legacy-timeperiod",
          "legacy-timeperiod"
        ],
        "type": "TimePeriod",
        "update": {
          "arguments": [
            "tp",
            "begin",
            "end"
          ],
          "deprecated": false,
          "name": "Internal#LegacyTimePeriod",
          "side_effect_free": false,
          "type": "Function"
        },
        "valid_begin": 1619438679.288072,
        "valid_end": 1619528706.796931,
        "vars": null,
        "version": 0,
        "zone": "ris-global"
      },
      "joins": {},
      "meta": {},
      "name": "Feiertage",
      "type": "TimePeriod"
    }
  ]
}

for completition, her is the content, of ouer timeperiods.conf file

/**
 * Sample timeperiods for Icinga 2 requiring
 * 'legacy-timeperiod' template from the Icinga
 * Template Library (ITL).
 * Check the documentation for details.
 */

object TimePeriod "24x7" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 24x7 TimePeriod"
  ranges = {
    "monday"    = "00:00-24:00"
    "tuesday"   = "00:00-24:00"
    "wednesday" = "00:00-24:00"
    "thursday"  = "00:00-24:00"
    "friday"    = "00:00-24:00"
    "saturday"  = "00:00-24:00"
    "sunday"    = "00:00-24:00"
  }
}

object TimePeriod "9to5" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 9to5 TimePeriod"

  excludes = [ "Feiertage" ]

  ranges = {
    "monday"    = "09:00-17:00"
    "tuesday"   = "09:00-17:00"
    "wednesday" = "09:00-17:00"
    "thursday"  = "09:00-17:00"
    "friday"    = "09:00-17:00"
  }
}

object TimePeriod "7to5" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 7to5 TimePeriod"

  excludes = [ "Feiertage" ]

  ranges = {
    "monday"    = "07:00-17:00"
    "tuesday"   = "07:00-17:00"
    "wednesday" = "07:00-17:00"
    "thursday"  = "07:00-17:00"
    "friday"    = "07:00-17:00"
  }
}

object TimePeriod "non-wrk-houers" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 Non Work Houers TimePeriod"
  includes = [ "24x7" ]
  excludes = [ "7to5" ]
  prefer_includes = false

}

object TimePeriod "7to22" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 7to22 TimePeriod"

  excludes = [ "Feiertage" ]

  ranges = {
    "monday"    = "07:00-22:00"
    "tuesday"   = "07:00-22:00"
    "wednesday" = "07:00-22:00"
    "thursday"  = "07:00-22:00"
    "friday"    = "07:00-22:00"
  }
}

object TimePeriod "6to22" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 6to22 TimePeriod"
  ranges = {
    "monday"    = "06:00-22:00"
    "tuesday"   = "06:00-22:00"
    "wednesday" = "06:00-22:00"
    "thursday"  = "06:00-22:00"
    "friday"    = "06:00-22:00"
    "saturday"  = "07:00-22:00"
    "sunday"    = "07:00-22:00"

  }
}

object TimePeriod "TABS-Bereitschaft" {
  import "legacy-timeperiod"

  display_name = "TABS-Bereitschaft TimePeriod"
  ranges = {
    "monday"    = "17:00-22:00"
    "tuesday"   = "17:00-22:00"
    "wednesday" = "17:00-22:00"
    "thursday"  = "17:00-22:00"
    "friday"    = "17:00-22:00"
  }
}

object TimePeriod "never" {
  import "legacy-timeperiod"

  display_name = "Icinga 2 never TimePeriod"
  ranges = {
  }
}

object TimePeriod "Feiertage" {
  import "legacy-timeperiod"
  display_name = "Gesetzliche Feiertage; keine Meldungen"
  ranges = {
    "january 1"   = "00:00-24:00"               //Neujahr
    "january 6"   = "00:00-24:00"               //Heilige Drei Könige
    "april 25"    = "00:00-24:00"               //Tag der Befreiung Italiens
    "april 5"     = "00:00-24:00"               //Ostern
    "may 1"       = "00:00-24:00"               //Tag der arbeiter
    "june 2"      = "00:00-24:00"               //Tag der Republik Italien
    "august 15"   = "00:00-24:00"               //Ferragosto
    "november 1"  = "00:00-24:00"               //Allerheiligen
    "december 8"  = "00:00-24:00"               //Maria Empfängnis
    "december 25" = "00:00-24:00"               //Weihnachten
    "december 26" = "00:00-24:00"               //Stephanstag
  }
}

Your Environment

  • Version used (icinga2 --version): version: 2.12.3
  • Operating System and version: Red Hat Enterprise Linux Server release 7.9 (Maipo)
  • Enabled features (icinga2 feature list): Enabled features: api checker ido-mysql mainlog notification perfdata
  • Icinga Web 2 version and modules (System - About): 2.8.2
  • Config validation (icinga2 daemon -C):
[2021-04-27 11:45:19 +0200] information/cli: Icinga application loader (version: 2.12.3)
[2021-04-27 11:45:19 +0200] information/cli: Loading configuration file(s).
[2021-04-27 11:45:20 +0200] information/ConfigItem: Committing config item(s).
[2021-04-27 11:45:20 +0200] information/ApiListener: My API identity: icingam01-p.ad.raiffeisen.it
[2021-04-27 11:45:30 +0200] information/WorkQueue: #4 (DaemonUtility::LoadConfigFiles) items: 0, rate: 23.75/s (1425/min 1425/5min 1425/15min);
[2021-04-27 11:45:30 +0200] information/WorkQueue: #6 (ApiListener, RelayQueue) items: 0, rate:  0/s (0/min 0/5min 0/15min);
[2021-04-27 11:45:30 +0200] information/WorkQueue: #7 (ApiListener, SyncQueue) items: 0, rate:  0/s (0/min 0/5min 0/15min);
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'disable-nsclient-service-checks' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/ris-global/custom-objects/services/dependencies.conf: 23:1-23:61) for type 'Dependency' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'disable-esx-alarms-vcenter2-c' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/ris-global/custom-objects/services/dependencies.conf: 187:1-187:59) for type 'Dependency' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'disable-vsan-cluster-n4' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/ris-global/custom-objects/services/dependencies.conf: 212:1-212:53) for type 'Dependency' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'disable-vsan-cluster-vdia' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/ris-global/custom-objects/services/dependencies.conf: 224:1-224:55) for type 'Dependency' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'call-to-host-' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/call_ris-produktion.conf: 12:1-12:91) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'call-to-cto-host-work-hours' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/call_ris-produktion.conf: 31:1-31:56) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'mail-to-ris-dba' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/mail_ris-ssm.conf: 15:1-15:47) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'sms-to-dns-admin-service' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/sms_ris-plattformen.conf: 52:1-52:56) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'sms-datacenter-dr-10m_delay-host' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/sms_ris-produktion.conf: 29:1-29:61) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'sms-to-utscb' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/sms_ris-produktion.conf: 82:1-82:44) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'sms-test-to-unarm' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/sms_ris-produktion.conf: 96:1-96:49) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'sms-to-wdl-host' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/sms_wdl.conf: 1:0-1:43) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'sms-to-wdl-service' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/master/custom-objects/notifications/sms_wdl.conf: 12:1-12:50) for type 'Notification' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'vmware-cluster-clu-ast-downtime' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/ris-global/custom-objects/downtimes/downtimes.conf: 13:1-13:68) for type 'ScheduledDowntime' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'http-rcard' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 52:1-52:26) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'http-portal-menu' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 64:1-64:32) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'AX32Serv-service' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 141:1-141:32) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'AOS-service' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 153:1-153:27) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ReportServer-AX-service' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 165:1-165:39) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ReportServer-BI-service' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 177:1-177:39) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ETLJob-Status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 189:1-189:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'SQLJob-Status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 202:1-202:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'SQLPerformanceCounter' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 214:1-214:37) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'balancer-port' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 396:1-396:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule '' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 430:1-430:56) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'solaris-global-fs-assimoco' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 535:1-535:42) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ac-hiross' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 556:1-556:25) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'fireeye-activevms' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 579:1-579:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'rdp-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 729:1-729:26) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'd3-web' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 784:1-784:22) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'timeweb' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 829:1-829:23) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule '' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 942:1-942:62) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ReportServer$AX2012' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 1006:1-1006:35) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ReportServer$BI_PROD' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 1017:1-1017:36) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'BI Job Status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/service_apply.conf: 1159:1-1159:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'apache-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 434:1-434:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'arx3200-retransmission_delay' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 628:1-628:44) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'arx3200-server_response_time' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 646:1-646:44) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'arx3200-user_response_time' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 664:1-664:42) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'assisini3-webserver' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 700:1-700:35) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'assisini3-connectdb' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 712:1-712:35) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'am-eloam-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1026:1-1026:31) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'dm-rvs-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1040:1-1040:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ix-rvs-dbstatus' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1054:1-1054:31) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'https-status-elobase' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1065:1-1065:36) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'https-cert-expiration-elobase' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1076:1-1076:45) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ix-rvs-status-9091' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1130:1-1130:34) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ix-rvs-status-9092' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1146:1-1146:34) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ix-rvs-dbstatus-9091' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1162:1-1162:36) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ix-rvs-dbstatus-9092' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1174:1-1174:36) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'dm-rvstest-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1192:1-1192:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ft-rvstest-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1206:1-1206:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'is-rvstest-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1220:1-1220:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ix-rvstest-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1234:1-1234:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'sx-rvstest-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1248:1-1248:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'tr-rvstest-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1262:1-1262:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'am-eloam-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1276:1-1276:31) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'muleesb-pec-manager-wsdl' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1420:1-1420:40) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'hp-procurve-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1729:1-1729:34) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'hp-procurve-cpu' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1740:1-1740:31) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'hp-procurve-mem' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1756:1-1756:31) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'klima-status-all' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1893:1-1893:32) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'rvs-klima-temp' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1904:1-1904:30) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ups-health' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 1989:1-1989:26) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'ups-battery-status' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2003:1-2003:34) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-multipath' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2600:1-2600:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-alarms' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2612:1-2612:26) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-health' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2624:1-2624:26) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-readytime' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2638:1-2638:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-cpu-usage' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2652:1-2652:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-mem-usage' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2666:1-2666:29) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-services' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2680:1-2680:28) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-service-DCUI' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2691:1-2691:32) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-service-ntpd' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2703:1-2703:32) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'esx-service-vpxa' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 2715:1-2715:32) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health online' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3311:1-3311:34) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health build' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3326:1-3326:33) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health network' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3340:1-3340:35) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health physical' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3355:1-3355:36) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health data' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3369:1-3369:32) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health cluster' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3384:1-3384:35) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health limits' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3398:1-3398:34) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health hardware' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3412:1-3412:36) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'VSAN Health performance' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3426:1-3426:39) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'CPU Usage' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3851:1-3851:25) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'Disks' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3859:1-3859:21) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'Memory' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3867:1-3867:22) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'Event Log' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3875:1-3875:25) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'Services' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3883:1-3883:24) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] warning/ApplyRule: Apply rule 'Ris Process' (in /var/lib/icinga2/api/packages/director/400c8f3c-2c62-49ab-92a5-ecec2fa62ec7/zones.d/director-global/servicesets.conf: 3891:1-3891:27) for type 'Service' does not match anywhere!
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1320 Hosts.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 822 Downtimes.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 13 NotificationCommands.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 101 Comments.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 20823 Notifications.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 46 HostGroups.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 PerfdataWriter.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 4181 Dependencies.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 5 Zones.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 5 Endpoints.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 4 ApiUsers.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 398 CheckCommands.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 9 TimePeriods.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 3 UserGroups.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 51 Users.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 10734 Services.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 20 ServiceGroups.
[2021-04-27 11:45:32 +0200] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2021-04-27 11:45:34 +0200] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2021-04-27 11:45:34 +0200] information/cli: Finished validating the configuration file(s).
  • If you run multiple Icinga 2 instances, the zones.conf file (or icinga2 object list --type Endpoint and icinga2 object list --type Zone) from all affected nodes.

Icinga Master 1 (icingam01-p)

object Zone "director-global" {
        global = true
}

object Zone "ris-global" {
        global = true
}

object Endpoint "icingam01-p.ad.raiffeisen.it" {
        host = "icingam01-p.ad.raiffeisen.it"
}

object Endpoint "icingam02-p.ad.raiffeisen.it" {
        host = "icingam02-p.ad.raiffeisen.it"
}

object Zone "master" {
        endpoints = [ "icingam01-p.ad.raiffeisen.it", "icingam02-p.ad.raiffeisen.it" ]
}

object Endpoint "icingas01-p.ad.raiffeisen.it" {
        host = "icingas01-p.ad.raiffeisen.it"
        log_duration = 0
}

object Endpoint "icingas02-p.ad.raiffeisen.it" {
        host = "icingas02-p.ad.raiffeisen.it"
        log_duration = 0
}

object Zone "production" {
        endpoints = [ "icingas01-p.ad.raiffeisen.it", "icingas02-p.ad.raiffeisen.it" ]
        parent = "master"
}

object Endpoint "icingas09-p.ad.raiffeisen.it" {
        host = "icingas09-p.ad.raiffeisen.it"
        log_duration = 0
}

object Zone "test" {
        endpoints = [ "icingas09-p.ad.raiffeisen.it" ]
        parent = "master"
}

Icinga Master 2 (icingam02-p)

object Zone "director-global" {
        global = true
}

object Zone "ris-global" {
        global = true
}

object Endpoint "icingam01-p.ad.raiffeisen.it" {
        host = "icingam01-p.ad.raiffeisen.it"
}

object Endpoint "icingam02-p.ad.raiffeisen.it" {
        host = "icingam02-p.ad.raiffeisen.it"
}

object Zone "master" {
        endpoints = [ "icingam01-p.ad.raiffeisen.it", "icingam02-p.ad.raiffeisen.it" ]
}

object Endpoint "icingas01-p.ad.raiffeisen.it" {
        host = "icingas01-p.ad.raiffeisen.it"
        log_duration = 0
}

object Endpoint "icingas02-p.ad.raiffeisen.it" {
        host = "icingas02-p.ad.raiffeisen.it"
        log_duration = 0
}

object Zone "production" {
        endpoints = [ "icingas01-p.ad.raiffeisen.it", "icingas02-p.ad.raiffeisen.it" ]
        parent = "master"
}

object Endpoint "icingas09-p.ad.raiffeisen.it" {
        host = "icingas09-p.ad.raiffeisen.it"
        log_duration = 0
}

object Zone "test" {
        endpoints = [ "icingas09-p.ad.raiffeisen.it" ]
        parent = "master"
}
@davixd
Copy link

davixd commented May 14, 2021

Hello,
we have exactly the same problem. I was not sure, if maybe our config is wrong, so I did not open a bug report yet. But now after the german holiday (13. May 2021) it happen again and I saw your bug report, which I can also confirm.

Notifications and timeperiods are working in general.

Problem description:
As it comes to the excludes rules (for example holidays), the holiday will be correctly excluded and notifications are supressed. But the first day after the exclude rule is always also included in the exclude rule. I do not know why and how its happening, but it happened already several times.

For example:
13. May 2021 was excluded (german holiday) and yesterday all notifications for "Bereitschaft" got supressed correctly. Today (14. May 2021) which is out of the exclude rule, all notifications for "Bereitschaft" got again supressed fully, which should not happen.

And it seems not to depend on the duration of the exclude rule. I could also observe this behaviour for exclude rules which be set for 5 days. The day after gets always excluded as well. So basically: excludes = [ "feiertage-de-fix", "feiertage-de-dynamic" ] + 1

Before the exclude rule and after the exclude rule +1 it is running normally again.

Here is our setting and config:

rpm -qa |grep release
centos-release-7-9.2009.1.el7.centos.x86_64

rpm -qa |grep icinga
icingaweb2-common-2.8.2-1.el7.icinga.noarch
icingaweb2-vendor-HTMLPurifier-2.8.2-1.el7.icinga.noarch
icinga2-2.12.3-1.el7.icinga.x86_64
icingaweb2-vendor-dompdf-2.8.2-1.el7.icinga.noarch
icinga2-common-2.12.3-1.el7.icinga.x86_64
icinga-l10n-1.0.0-1.el7.icinga.noarch
icingaweb2-vendor-lessphp-2.8.2-1.el7.icinga.noarch
icingaweb2-vendor-Parsedown-2.8.2-1.el7.icinga.noarch
icingaweb2-vendor-JShrink-2.8.2-1.el7.icinga.noarch
icingacli-2.8.2-1.el7.icinga.noarch
icinga-rpm-release-7-4.el7.icinga.noarch
icingaweb2-vendor-zf1-2.8.2-1.el7.icinga.noarch
icinga2-ido-mysql-2.12.3-1.el7.icinga.x86_64
icingaweb2-2.8.2-1.el7.icinga.noarch
vim-icinga2-2.12.3-1.el7.icinga.x86_64
icinga2-bin-2.12.3-1.el7.icinga.x86_64
php-Icinga-2.8.2-1.el7.icinga.noarch

rpm -qa |grep maria
mariadb-5.5.68-1.el7.x86_64
mariadb-server-5.5.68-1.el7.x86_64
mariadb-libs-5.5.68-1.el7.x86_64

icinga2 feature list
Disabled features: command compatlog debuglog elasticsearch gelf graphite icingadb influxdb livestatus opentsdb statusdata syslog
Enabled features: api checker ido-mysql mainlog notification perfdata

timeperiods.conf:

object TimePeriod "bereitschaft" {
  display_name = "Bereitschaft"
  excludes = [ "feiertage-de-fix", "feiertage-de-dynamic" ]
  ranges = {
    "monday"    = "06:00-22:00"
    "tuesday"   = "06:00-22:00"
    "wednesday" = "06:00-22:00"
    "thursday"  = "06:00-22:00"
    "friday"    = "06:00-22:00"
  }
}

#####################
#Includes and Excludes#
#####################
object TimePeriod "feiertage-de-fix" {
  ranges = {
    "january 1" = "00:00-24:00"                 //new year's day
    "march 8" = "00:00-24:00"                   //international womens day
    "may 1" = "00:00-24:00"                     //Tag der Arbeit
    "october 03" = "00:00-24:00"                //Tag der deutschen Einheit
    "december 25" = "00:00-24:00"               //christmas holidays
    "december 26" = "00:00-24:00"               //christmas holidays
  }
}

object TimePeriod "feiertage-de-dynamic" {
  ranges = {
    "2020-04-10" = "00:00-24:00"                //Karlfreitag + Ostermontag
    "2020-04-13" = "00:00-24:00"
    "2021-04-02" = "00:00-24:00"
    "2021-04-05" = "00:00-24:00"
    "2022-04-15" = "00:00-24:00"
    "2022-04-18" = "00:00-24:00"

    "2020-05-21" = "00:00-24:00"                //Christi Himmelfahrt + Pfingsmontag
    "2020-06-01" = "00:00-24:00"
    "2021-05-13" = "00:00-24:00"
    "2021-05-24" = "00:00-24:00"
    "2022-05-26" = "00:00-24:00"
    "2022-06-06" = "00:00-24:00"
  }
}

If you need more information, just let me know.

Many thanks in advance!

Best regards
David

@Kaelnor
Copy link

Kaelnor commented May 14, 2021

Hi,

I have almost the exact same behavior except it is linked to includes and not excludes.

I also think there are 2 problems here that might be linked in some way:

  • There may be a drift in the timeperiod, as the next 24h are somehow included in some cases as noticed by @davixd and others.
  • There is definitely a runtime issue with how includes and excludes ranges are not cascading correctly to compute is_inside.

For some context, yesterday (May 13th) was a holiday in France and we always have someone on call outside of workhours. Today, I noticed that notifications are still sent though they should not be !

Below is the configuration snippet for relevant TimePeriods:

object TimePeriod "holidays" {
  display_name = "holidays TimePeriod"
  ranges = {
    "january 1" = "00:00-24:00" // Jour de l'an
    "2021-04-05" = "00:00-24:00" // Lundi de pâques 2021
    "may 1" = "00:00-24:00" // Fête du travail
    "may 8" = "00:00-24:00" // Jour de la victoire
    "2021-05-13" = "00:00-24:00" // Ascension 2021
    "2021-05-24" = "00:00-24:00" // Pentecôte 2021
    "july 14" = "00:00-24:00" // Fête nationale
    "august 15" = "00:00-24:00" // Assomption
    "november 1" = "00:00-24:00" // Toussaint
    "november 11" = "00:00-24:00" // Armistice
    "december 25" = "00:00-24:00" // Noël
  }
}

object TimePeriod "weekends" {
  display_name = "Weekends TimePeriod"
  ranges = {
    "saturday"  = "00:00-24:00"
    "sunday"    = "00:00-24:00"
  }
}

object TimePeriod "non-workhours" {
  display_name = "Non-workhours TimePeriod"
  includes = ["weekends", "holidays"]

  ranges = {
    "monday"    = "00:00-09:00,18:00-24:00"
    "tuesday"   = "00:00-09:00,18:00-24:00"
    "wednesday" = "00:00-09:00,18:00-24:00"
    "thursday"  = "00:00-09:00,18:00-24:00"
    "friday"    = "00:00-09:00,18:00-24:00"
  }
}

One of the notification objects is defined like this:

apply Notification "astreinte-mail-service-notification" to Service {
  import "mail-service-notification"

  users = ["afoulon", "cbrassel_gmail"]
  states = [ Warning, Critical, Unknown ]
  types = [ Problem, FlappingStart ]

  period = "non-workhours"
  times = {
    begin = 5m
  }

  assign where ( host.vars.notification.astreinte.enabled && !service.vars.notification.astreinte.disabled )
}

And the imported template:

template Notification "mail-service-notification" {
  command = "mail-service-notification"

  states = [ OK, Warning, Critical, Unknown ]
  types = [ Problem, Acknowledgement, Recovery, Custom,
            FlappingStart, FlappingEnd,
            DowntimeStart, DowntimeEnd, DowntimeRemoved ]

  interval = 5m
  period = "24x7"
}

From the API, I checked that the period for the created Notification is correct:

Object 'php7-4.el.dc2.mngt.io!phpfpm_status-7440!astreinte-mail-service-notification' of type 'Notification':
  % declared in '/etc/icinga2/zones.d/master/notifications/objects/astreinte-mail.conf', lines 15:1-15:67
  * __name = "php7-4.el.dc2.mngt.io!phpfpm_status-7440!astreinte-mail-service-notification"
  * command = "mail-service-notification"
    % = modified in '/etc/icinga2/zones.d/master/notifications/templates/mail.conf', lines 30:3-30:39
  * command_endpoint = ""
  * host_name = "php7-4.el.dc2.mngt.io"
    % = modified in '/etc/icinga2/zones.d/master/notifications/objects/astreinte-mail.conf', lines 15:1-15:67
  * interval = 300
    % = modified in '/etc/icinga2/zones.d/master/notifications/templates/mail.conf', lines 43:3-43:15
  * name = "astreinte-mail-service-notification"
  * package = "_etc"
    % = modified in '/etc/icinga2/zones.d/master/notifications/objects/astreinte-mail.conf', lines 15:1-15:67
  * period = "non-workhours"
...

However, when checking TimePeriods with the API (today, May 14th), I noticed that is_inside was still true for the holidays TimePeriod and also for non-workhours. Unfortunately, I don't have the original query result.

Then, I also noticed that reloading icinga2 did affect the holidays TimePeriod as is_inside changed to false but not the 'non-workhours` is_inside value which stayed true. Both were correctly recalculated when restarting icinga2.

How to reproduce

I tested it further and this behavior can be easily reproduced. Let's try to add a range inside holidays.

Initial configuration + restart to have a clean config

  • Config
object TimePeriod "holidays" {
  display_name = "holidays TimePeriod"
  ranges = {
    "january 1" = "00:00-24:00" // Jour de l'an
    "2021-04-05" = "00:00-24:00" // Lundi de pâques 2021
    "may 1" = "00:00-24:00" // Fête du travail
    "may 8" = "00:00-24:00" // Jour de la victoire
    "2021-05-13" = "00:00-24:00" // Ascension 2021
    "2021-05-14" = "00:00-24:00" // <------ ADDED THE CURRENT DAY FOR TESTING PURPOSES 
    "2021-05-24" = "00:00-24:00" // Pentecôte 2021
    "july 14" = "00:00-24:00" // Fête nationale
    "august 15" = "00:00-24:00" // Assomption
    "november 1" = "00:00-24:00" // Toussaint
    "november 11" = "00:00-24:00" // Armistice
    "december 25" = "00:00-24:00" // Noël
  }
}
  • API calls
{
    "results": [
        {
            "attrs": {
                "__name": "holidays",
                "active": true,
                "display_name": "holidays TimePeriod",
                "excludes": [],
                "ha_mode": 0.0,
                "includes": [],
                "is_inside": true,
                "name": "holidays",
                "original_attributes": null,
                "package": "_etc",
                "paused": false,
                "prefer_includes": true,
                "ranges": {
                    "2021-04-05": "00:00-24:00",
                    "2021-05-13": "00:00-24:00",
                    "2021-05-14": "00:00-24:00",
                    "2021-05-24": "00:00-24:00",
                    "august 15": "00:00-24:00",
                    "december 25": "00:00-24:00",
                    "january 1": "00:00-24:00",
                    "july 14": "00:00-24:00",
                    "may 1": "00:00-24:00",
                    "may 8": "00:00-24:00",
                    "november 1": "00:00-24:00",
                    "november 11": "00:00-24:00"
                },
                "segments": [
                    {
                        "begin": 1620943200.0,
                        "end": 1621029600.0
                    }
                ],
                "source_location": {
                    "first_column": 1.0,
                    "first_line": 27.0,
                    "last_column": 28.0,
                    "last_line": 27.0,
                    "path": "/etc/icinga2/zones.d/master/timeperiods.conf"
                },
                "templates": [
                    "holidays",
                    "legacy-timeperiod"
                ],
                "type": "TimePeriod",
                "update": {
                    "arguments": [
                        "tp",
                        "begin",
                        "end"
                    ],
                    "deprecated": false,
                    "name": "Internal#LegacyTimePeriod",
                    "side_effect_free": false,
                    "type": "Function"
                },
                "valid_begin": 1620943200.0,
                "valid_end": 1621086153.809217,
                "vars": null,
                "version": 0.0,
                "zone": "master"
            },
            "joins": {},
            "meta": {},
            "name": "holidays",
            "type": "TimePeriod"
        }
    ]
}
{
    "results": [
        {
            "attrs": {
                "__name": "non-workhours",
                "active": true,
                "display_name": "Non-workhours TimePeriod",
                "excludes": [],
                "ha_mode": 0.0,
                "includes": [
                    "weekends",
                    "holidays"
                ],
                "is_inside": true,
                "name": "non-workhours",
                "original_attributes": null,
                "package": "_etc",
                "paused": false,
                "prefer_includes": true,
                "ranges": {
                    "friday": "00:00-09:00,18:00-24:00",
                    "monday": "00:00-09:00,18:00-24:00",
                    "thursday": "00:00-09:00,18:00-24:00",
                    "tuesday": "00:00-09:00,18:00-24:00",
                    "wednesday": "00:00-09:00,18:00-24:00"
                },
                "segments": [
                    {
                        "begin": 1620943200.0,
                        "end": 1621029600.0
                    },
                    {
                        "begin": 1621008000.0,
                        "end": 1621116000.0
                    }
                ],
                "source_location": {
                    "first_column": 1.0,
                    "first_line": 56.0,
                    "last_column": 33.0,
                    "last_line": 56.0,
                    "path": "/etc/icinga2/zones.d/master/timeperiods.conf"
                },
                "templates": [
                    "non-workhours",
                    "legacy-timeperiod"
                ],
                "type": "TimePeriod",
                "update": {
                    "arguments": [
                        "tp",
                        "begin",
                        "end"
                    ],
                    "deprecated": false,
                    "name": "Internal#LegacyTimePeriod",
                    "side_effect_free": false,
                    "type": "Function"
                },
                "valid_begin": 1620943200.0,
                "valid_end": 1621116000.0,
                "vars": null,
                "version": 0.0,
                "zone": "master"
            },
            "joins": {},
            "meta": {},
            "name": "non-workhours",
            "type": "TimePeriod"
        }
    ]
}

We are inside both TimePeriods as expected.

Remove a range in holidays

We remove the following range entry:

    "2021-05-14" = "00:00-24:00" // <------ ADDED FOR TESTING PURPOSES
  • After a reload:
{
    "results": [
        {
            "attrs": {
                "__name": "holidays",
                "active": true,
                "display_name": "holidays TimePeriod",
                "excludes": [],
                "ha_mode": 0.0,
                "includes": [],
                "is_inside": false,
                "name": "holidays",
                "original_attributes": null,
                "package": "_etc",
                "paused": false,
                "prefer_includes": true,
                "ranges": {
                    "2021-04-05": "00:00-24:00",
                    "2021-05-13": "00:00-24:00",
                    "2021-05-24": "00:00-24:00",
                    "august 15": "00:00-24:00",
                    "december 25": "00:00-24:00",
                    "january 1": "00:00-24:00",
                    "july 14": "00:00-24:00",
                    "may 1": "00:00-24:00",
                    "may 8": "00:00-24:00",
                    "november 1": "00:00-24:00",
                    "november 11": "00:00-24:00"
                },
                "segments": [],
                "source_location": {
                    "first_column": 1.0,
                    "first_line": 27.0,
                    "last_column": 28.0,
                    "last_line": 27.0,
                    "path": "/etc/icinga2/zones.d/master/timeperiods.conf"
                },
                "templates": [
                    "holidays",
                    "legacy-timeperiod"
                ],
                "type": "TimePeriod",
                "update": {
                    "arguments": [
                        "tp",
                        "begin",
                        "end"
                    ],
                    "deprecated": false,
                    "name": "Internal#LegacyTimePeriod",
                    "side_effect_free": false,
                    "type": "Function"
                },
                "valid_begin": 1620943200.0,
                "valid_end": 1621086572.667013,
                "vars": null,
                "version": 0.0,
                "zone": "master"
            },
            "joins": {},
            "meta": {},
            "name": "holidays",
            "type": "TimePeriod"
        }
    ]
}
{
    "results": [
        {
            "attrs": {
                "__name": "non-workhours",
                "active": true,
                "display_name": "Non-workhours TimePeriod",
                "excludes": [],
                "ha_mode": 0.0,
                "includes": [
                    "weekends",
                    "holidays"
                ],
                "is_inside": true,
                "name": "non-workhours",
                "original_attributes": null,
                "package": "_etc",
                "paused": false,
                "prefer_includes": true,
                "ranges": {
                    "friday": "00:00-09:00,18:00-24:00",
                    "monday": "00:00-09:00,18:00-24:00",
                    "thursday": "00:00-09:00,18:00-24:00",
                    "tuesday": "00:00-09:00,18:00-24:00",
                    "wednesday": "00:00-09:00,18:00-24:00"
                },
                "segments": [
                    {
                        "begin": 1620943200.0,
                        "end": 1621029600.0
                    },
                    {
                        "begin": 1621008000.0,
                        "end": 1621116000.0
                    }
                ],
                "source_location": {
                    "first_column": 1.0,
                    "first_line": 56.0,
                    "last_column": 33.0,
                    "last_line": 56.0,
                    "path": "/etc/icinga2/zones.d/master/timeperiods.conf"
                },
                "templates": [
                    "non-workhours",
                    "legacy-timeperiod"
                ],
                "type": "TimePeriod",
                "update": {
                    "arguments": [
                        "tp",
                        "begin",
                        "end"
                    ],
                    "deprecated": false,
                    "name": "Internal#LegacyTimePeriod",
                    "side_effect_free": false,
                    "type": "Function"
                },
                "valid_begin": 1620943200.0,
                "valid_end": 1621116000.0,
                "vars": null,
                "version": 0.0,
                "zone": "master"
            },
            "joins": {},
            "meta": {},
            "name": "non-workhours",
            "type": "TimePeriod"
        }
    ]
}

This time we are not inside holidays anymore BUT we are still inside non-workhours !

After restarting icinga2

I restart the service with systemctl restart icinga2:

{
    "results": [
        {
            "attrs": {
                "__name": "holidays",
                "active": true,
                "display_name": "holidays TimePeriod",
                "excludes": [],
                "ha_mode": 0.0,
                "includes": [],
                "is_inside": false,
                "name": "holidays",
                "original_attributes": null,
                "package": "_etc",
                "paused": false,
                "prefer_includes": true,
                "ranges": {
                    "2021-04-05": "00:00-24:00",
                    "2021-05-13": "00:00-24:00",
                    "2021-05-24": "00:00-24:00",
                    "august 15": "00:00-24:00",
                    "december 25": "00:00-24:00",
                    "january 1": "00:00-24:00",
                    "july 14": "00:00-24:00",
                    "may 1": "00:00-24:00",
                    "may 8": "00:00-24:00",
                    "november 1": "00:00-24:00",
                    "november 11": "00:00-24:00"
                },
                "segments": [],
                "source_location": {
                    "first_column": 1.0,
                    "first_line": 27.0,
                    "last_column": 28.0,
                    "last_line": 27.0,
                    "path": "/etc/icinga2/zones.d/master/timeperiods.conf"
                },
                "templates": [
                    "holidays",
                    "legacy-timeperiod"
                ],
                "type": "TimePeriod",
                "update": {
                    "arguments": [
                        "tp",
                        "begin",
                        "end"
                    ],
                    "deprecated": false,
                    "name": "Internal#LegacyTimePeriod",
                    "side_effect_free": false,
                    "type": "Function"
                },
                "valid_begin": 1620997472.664512,
                "valid_end": 1621087617.413173,
                "vars": null,
                "version": 0.0,
                "zone": "master"
            },
            "joins": {},
            "meta": {},
            "name": "holidays",
            "type": "TimePeriod"
        }
    ]
}
{
    "results": [
        {
            "attrs": {
                "__name": "non-workhours",
                "active": true,
                "display_name": "Non-workhours TimePeriod",
                "excludes": [],
                "ha_mode": 0.0,
                "includes": [
                    "weekends",
                    "holidays"
                ],
                "is_inside": false,
                "name": "non-workhours",
                "original_attributes": null,
                "package": "_etc",
                "paused": false,
                "prefer_includes": true,
                "ranges": {
                    "friday": "00:00-09:00,18:00-24:00",
                    "monday": "00:00-09:00,18:00-24:00",
                    "thursday": "00:00-09:00,18:00-24:00",
                    "tuesday": "00:00-09:00,18:00-24:00",
                    "wednesday": "00:00-09:00,18:00-24:00"
                },
                "segments": [
                    {
                        "begin": 1620943200.0,
                        "end": 1620975600.0
                    },
                    {
                        "begin": 1621008000.0,
                        "end": 1621116000.0
                    }
                ],
                "source_location": {
                    "first_column": 1.0,
                    "first_line": 56.0,
                    "last_column": 33.0,
                    "last_line": 56.0,
                    "path": "/etc/icinga2/zones.d/master/timeperiods.conf"
                },
                "templates": [
                    "non-workhours",
                    "legacy-timeperiod"
                ],
                "type": "TimePeriod",
                "update": {
                    "arguments": [
                        "tp",
                        "begin",
                        "end"
                    ],
                    "deprecated": false,
                    "name": "Internal#LegacyTimePeriod",
                    "side_effect_free": false,
                    "type": "Function"
                },
                "valid_begin": 1620943200.0,
                "valid_end": 1621116000.0,
                "vars": null,
                "version": 0.0,
                "zone": "master"
            },
            "joins": {},
            "meta": {},
            "name": "non-workhours",
            "type": "TimePeriod"
        }
    ]
}

Now, both are false as expected.

NOTE: This can be reproduced when adding or removing ranges in an included TimePeriod. I did not test the excluded TPs but I expect to be the same behavior.

Conclusion

Issue 1 (tested): Adding or removing a range to an included or excluded TP does not affect the runtime is_inside variable for TPs where it is included/excluded.

Issue 2 (not tested): The effective duration for TPs are sometimes calculated incorrectly and can extend 24h after a range is expired.

Let me know if a separate issue should be opened.

Environment

  • OS: Ubuntu 18.04.5 LTS
  • icinga2 --version: r2.12.3-1
  • icinga2 feature list:
Disabled features: command compatlog debuglog elasticsearch gelf graphite icingadb influxdb livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker ido-mysql mainlog notification
  • icinga2 daemon -C:
√ root@icinga2 /etc/icinga2/zones.d/master # icinga2 daemon -C
[2021-05-14 16:32:56 +0200] information/cli: Icinga application loader (version: r2.12.3-1)
[2021-05-14 16:32:56 +0200] information/cli: Loading configuration file(s).
[2021-05-14 16:32:56 +0200] information/ConfigItem: Committing config item(s).
[2021-05-14 16:32:56 +0200] information/ApiListener: My API identity: icinga2.cms.dc2.mngt.io
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 747 Hosts.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 4 Downtimes.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 8 NotificationCommands.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 155 Comments.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 2140 Notifications.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 33 HostGroups.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 301 Zones.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 299 Endpoints.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 4 ApiUsers.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 290 CheckCommands.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 9 TimePeriods.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 2 UserGroups.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 9 Users.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 7728 Services.
[2021-05-14 16:32:57 +0200] information/ConfigItem: Instantiated 3 ServiceGroups.
[2021-05-14 16:32:57 +0200] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2021-05-14 16:32:57 +0200] information/cli: Finished validating the configuration file(s).

@davixd
Copy link

davixd commented May 2, 2022

Hi Guys,
as you already know, this bug affected me already since icinga2-2.12.3-1.el7. With icinga2-2.13.2-1.el7 the bug was gone. Today I updated to icinga2-2.13.3-1.el7 and the bug is back. Yesterday was the 1. May (holiday). Notifications arrived today in the morning with icinga2-2.13.2-1.el7, right after update to icinga2-2.13.3-1.el7, the notifications are missing again.

How is the status on the bug?

@devopstt
Copy link

Hey, just want to add, we had the same issue yesterday. Looking back to 6.6 and 1.5. I can see it happend too.
With performance data in influx we can track all the public holidays from the past and its the same behavior every time. The check is not executed and we have no performance data.

Funny enough, it seems like a deployment with the director corrects the problem (I think its related to the agent reload on every machine.) and the check will be executed like allways.

current version: r2.13.2-1

zones.d/director-global/timeperiods.conf

object TimePeriod "holidays" {
    import "[legacy-timeperiod](https://*********/director/timeperiod?name=legacy-timeperiod)"
    display_name = "holidays"
    ranges = {
        "2022-01-01"	= "00:00-24:00"
        "2022-04-15"	= "00:00-24:00"
        "2022-04-18"	= "00:00-24:00"
        "2022-05-01"	= "00:00-24:00"
        "2022-05-26"	= "00:00-24:00"
        "2022-06-06"	= "00:00-24:00"
        "2022-06-16"	= "00:00-24:00"
        "2022-10-03"	= "00:00-24:00"
        "2022-11-01"	= "00:00-24:00"
        "2022-12-25"	= "00:00-24:00"
        "2022-12-26"	= "00:00-24:00"
    }
}
zones.d/director-global/timeperiods.conf

object TimePeriod "workhours" {
    import "[legacy-timeperiod](https://**********/director/timeperiod?name=legacy-timeperiod)"
    display_name = "Workhours (08-17 / Mo-Fr)"
    excludes = [ "holidays" ]
    ranges = {
        "friday"	= "08:00-17:00"
        "monday"	= "08:00-17:00"
        "thursday"	= "08:00-17:00"
        "tuesday"	= "08:00-17:00"
        "wednesday"	= "08:00-17:00"
    }
}

@Kaelnor
Copy link

Kaelnor commented May 30, 2023

Any news on this ? This bug is still affecting the latest release r2.13.7-1.

@davixd
Copy link

davixd commented May 30, 2023

@Kaelnor
to my knowledge the bug is still not fixed. I can only offer you a workaround. Create a timeperiods.regular.conf and timeperiods-holidays.conf. Switch the confs at holidays and back with Ansible or a Cron job and include a reload or restart job.

Best regards
David

@cruelsmith
Copy link

cruelsmith commented May 31, 2023

That feature was introduced in 2.5.0 (2016 #2040) working and broke somewhere at 2.10.x (2019) ? At least when i see #7398 .

Would be at least nice for any administrator that in the current online documentation a warning will be added that the include / exclude feature for timeperiod has issues and it should not be used in any production environment to avoid dropped notifications. 😒

People just looking for examples of inclusion / exclusion and get an example that have issues and lead to missing notifications:
https://icinga.com/docs/icinga-2/2.13/doc/08-advanced-topics/#time-periods-inclusion-and-exclusion

@slalomsk8er
Copy link
Contributor

Would be at least nice for any administrator that in the current online documentation a warning will be added that the include / exclude feature for timeperiod has issues and it should not be used in any production environment to avoid dropped notifications. unamused

I can attest to that as I just had to flatten a time-period with includes & excludes before it worked for scheduling a service check. I just had to excuse a couple of false alarms before I gave up and stupidified the time-period.

cruelsmith added a commit to pixelpark/monitoring-checks that referenced this issue May 31, 2023
Will return every day of the year that are not holidays:
* Added options to adjust the time of these days.
* Added options to skip spefic week days.

Replaced fixed half day for chrismas and new year with the option to add
additional holidays that should be respected int he output.

Needed since icinga2 has issues with excludes
Icinga/icinga2#8741 (comment)
@cruelsmith
Copy link

cruelsmith commented Jun 1, 2023

@slalomsk8er What version did you run that your stupidified timeperiod worked? Is ask because with 2.13.7 even this does not work for me. I created #9781 with all checks it did when you also want to verify it.

@slalomsk8er
Copy link
Contributor

slalomsk8er commented Jun 1, 2023

@cruelsmith Version r2.13.7-1 works with the following config and I didn't get any false alarms on weekends like I did with includes and excludes.

apply Service "File Age - XXX.LOG" {
...
    check_period = "helpdesk-hours"
...
}
...
object TimePeriod "helpdesk-hours" {
    import "legacy-timeperiod"
    display_name = "Mo - Fr 07:00 - 17:00 "
    ranges = {
        "friday"	= "07:00-17:00"
        "monday"	= "07:00-17:00"
        "thursday"	= "07:00-17:00"
        "tuesday"	= "07:00-17:00"
        "wednesday"	= "07:00-17:00"
    }
}

@cruelsmith
Copy link

@slalomsk8er Thank you. That proves my test weekday from #9781.

@lippserd
Copy link
Member

We have also dealt with this issue in the course of 2.14, but have not achieved a satisfactory result in a reasonable time frame. Unfortunately, no minor bugfixes will help anymore, but the complete handling would have to be rewritten. Timeperiods for notifications will be reimplemented with Icinga Notifications and we have to ask ourselves how to proceed with timeperiods for checks. Since we are focusing on Icinga Notifications for now, honestly nothing will happen with this issue for the time being.

@lippserd lippserd added the stalled Blocked or not relevant yet label Jul 14, 2023
@yhabteab yhabteab linked a pull request Jan 29, 2024 that will close this issue
@yhabteab yhabteab removed the stalled Blocked or not relevant yet label Jan 29, 2024
@yhabteab yhabteab added this to the 2.15.0 milestone Jan 29, 2024
@yhabteab yhabteab added the ref/IP label May 8, 2024
@yhabteab
Copy link
Member

yhabteab commented May 8, 2024

ref/IP/53389

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

Successfully merging a pull request may close this issue.

9 participants