Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[dev.icinga.com #13239] It's hard to tell if timeperiod exlusions are actually working from the cli #4795

Closed
icinga-migration opened this issue Nov 18, 2016 · 3 comments
Labels
area/cli Command line helpers bug Something isn't working

Comments

@icinga-migration
Copy link

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

Created by kowalskimn on 2016-11-18 09:09:07 +00:00

Assignee: kowalskimn
Status: Closed (closed on 2016-12-07 21:22:52 +00:00)
Target Version: (none)
Last Update: 2016-12-07 21:22:52 +00:00 (in Redmine)

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

I have defined a timeperiod like so :

@object TimePeriod "workhours" {
import "legacy-timeperiod"

display_name = "Typical work hours"
ranges = {
"monday" = "08:00-16:00"
"tuesday" = "08:00-16:00"
"wednesday" = "08:00-16:00"
"thursday" = "08:00-16:00"
"friday" = "08:00-16:00"
}
}
@

now i have defined another one using the exclusion logic

@object TimePeriod "non-workhours" {
import "legacy-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"
//no sunday
}
// except for work hours
excludes = [ "workhours" ]
}
@

However, when i verify it from the cli, it seems that the exclusion is not working :

@ icinga2 object list -t timeperiod -n "non-workhours"
Object 'non-workhours' of type 'TimePeriod':
% declared in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 1:0-1:32

  • __name = "non-workhours"

  • display_name = "non-workhours"

  • excludes = [ "workhours" ]
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 18:2-18:27

  • includes = [ ]

  • name = "non-workhours"

  • package = "_etc"

  • prefer_includes = false
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 6:2-6:24

  • ranges
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 10:2-17:2

  • friday = "00:00-24:00"

  • monday = "00:00-24:00"

  • saturday = "00:00-24:00"

  • thursday = "00:00-24:00"

  • tuesday = "00:00-24:00"

  • wednesday = "00:00-24:00"

  • templates = [ "non-workhours", "legacy-timeperiod" ]
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 1:0-1:32
    % = modified in 'icinga-itl.conf', lines 23:2-23:56

  • type = "TimePeriod"

  • update
    % = modified in 'icinga-itl.conf', lines 24:3-24:37

  • type = "Function"

  • vars = null

  • zone = "global"
    @

@icinga-migration
Copy link
Author

Updated by kowalskimn on 2016-11-18 09:09:57 +00:00

for some reason the last paste does not format correctly, i'll try again.

Object 'non-workhours' of type 'TimePeriod':
  % declared in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 1:0-1:32
  * __name = "non-workhours"
  * display_name = "non-workhours"
  * excludes = [ "workhours" ]
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 18:2-18:27
  * includes = [ ]
  * name = "non-workhours"
  * package = "_etc"
  * prefer_includes = false
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 6:2-6:24
  * ranges
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 10:2-17:2
    * friday = "00:00-24:00"
    * monday = "00:00-24:00"
    * saturday = "00:00-24:00"
    * thursday = "00:00-24:00"
    * tuesday = "00:00-24:00"
    * wednesday = "00:00-24:00"
  * templates = [ "non-workhours", "legacy-timeperiod" ]
    % = modified in '/etc/icinga2/zones.d/global/timeperiod/non-workhours.conf', lines 1:0-1:32
    % = modified in 'icinga-itl.conf', lines 23:2-23:56
  * type = "TimePeriod"
  * update
    % = modified in 'icinga-itl.conf', lines 24:3-24:37
    * type = "Function"
  * vars = null
  * zone = "global"

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-11-18 09:21:59 +00:00

  • Status changed from New to Feedback
  • Assigned to set to kowalskimn

Exclusion is evaluated at runtime when calculating the time period segments. That is not visible in configuration objects.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-12-07 21:22:52 +00:00

  • Status changed from Feedback to Closed

@icinga-migration icinga-migration added bug Something isn't working area/cli Command line helpers labels Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Command line helpers bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant