I have checked the debug log and was surprised to see that it seems to parse the time ranges twice during start and that those time stamps are well off:

[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: '2016-02-10' 
=> 1457647200 -> 1457733600, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: 'february 04' 
=> 1454540400 -> 1454626800, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: 'saturday' => 
1455318000 -> 1455404400, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: 'sunday' => 
1455404400 -> 1455490800, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: '2016-02-10' 
=> 1457650800 -> 1457737200, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: 'february 04' 
=> 1454540400 -> 1454626800, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: 'saturday' => 
1455318000 -> 1455404400, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: ParseTimeRange: 'sunday' => 
1455404400 -> 1455490800, stride: 1
[2016-02-09 07:50:03 +0100] debug/LegacyTimePeriod: Legacy timeperiod update 
returned 0 segments.
[2016-02-09 07:50:03 +0100] debug/TimePeriod: Removing segment 'Tue Feb  9 07:50:03 
2016' <-> 'Wed Feb 10 07:50:03 2016' from TimePeriod 'rufbereitschaft2'
[2016-02-09 07:50:03 +0100] debug/TimePeriod: Dumping TimePeriod 
'rufbereitschaft2'
[2016-02-09 07:50:03 +0100] debug/TimePeriod: Valid from 'Tue Feb  9 06:46:19 
2016' until 'Wed Feb 10 07:50:03 2016
[2016-02-09 07:50:03 +0100] debug/TimePeriod: ---
[2016-02-09 07:50:03 +0100] debug/TimePeriod: Dumping TimePeriod 
'rufbereitschaft2'
[2016-02-09 07:50:03 +0100] debug/TimePeriod: Valid from 'Tue Feb  9 06:46:19 
2016' until 'Wed Feb 10 07:50:03 2016
[2016-02-09 07:50:03 +0100] debug/TimePeriod: ---

If you look at the time stamps for 2016-02-10:

$ date -d @1457647200
Thu Mar 10 23:00:00 CET 2016
$ date -d @1457733600
Fri Mar 11 23:00:00 CET 2016
$ date -d @1457650800
Fri Mar 11 00:00:00 CET 2016
$ date -d @1457737200
Sat Mar 12 00:00:00 CET 2016

So it's one month and one day off and seems to be UTC based, except for the second time. So I find it not surprising that the time periods don't work...

This is the object:

Object 'rufbereitschaft2' of type 'TimePeriod':
  % declared in '/etc/icinga2/conf.d/timeperiods.conf', lines 70:1-70:36
  * __name = "rufbereitschaft2"
  * display_name = "Rufbereitschaft TimePeriod"
    % = modified in '/etc/icinga2/conf.d/timeperiods.conf', lines 73:3-73:45
  * name = "rufbereitschaft2"
  * package = "_etc"
  * ranges
    % = modified in '/etc/icinga2/conf.d/timeperiods.conf', lines 74:3-80:3
    * 2016-02-10 = "06:00-18:00"
    * february 04 = "00:00-24:00"
    * saturday = "06:00-18:00"
    * sunday = "06:00-18:00"
  * templates = [ "rufbereitschaft2", "legacy-timeperiod" ]
    % = modified in '/etc/icinga2/conf.d/timeperiods.conf', lines 70:1-70:36
    % = modified in '/usr/share/icinga2/include/timeperiod.conf', lines 
20:1-20:39
  * type = "TimePeriod"
  * update
    % = modified in '/usr/share/icinga2/include/timeperiod.conf', lines 
21:2-21:26
    * type = "Function"
  * vars = null
  * zone = ""

This looks very much like a bug to me...

Anyone?

-Gerald





On 04/02/16 16:47, Gerald Vogt wrote:
Hi!

I am testing some time periods with specific dates but I seem to fail...

Server time is:

# date
Thu Feb  4 16:39:52 CET 2016

I do this:

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

   display_name = "Rufbereitschaft TimePeriod"
   ranges = {
     "saturday"        = "06:00-18:00"
     "sunday"        = "06:00-18:00"
   }
}

and no notifications are sent. OK.

I add

     "february 04"    = "00:00-24:00"

and notifications are sent. OK.

I replace the addition with this:

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

and it sends notifications, too. OK.

now I replace the addition with this:

     "2016-02-04"    = "00:00-24:00"

but it doesn't send out notifications. I even tried 2016-04-02, but in
vain. I get anything working but a time range on a specific date, at
least today.

Any idea what I might do wrong?

Thanks,

Gerald
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to