Open-ended (endless) repeating timeperiods?

I use to be able to create an endlessly repeating timeperiod by specifying date and repeating interval period in days (“2020-02-19 / 35” = “00:00-24:00”), which would repeat endlessly at the specified interval (nagios core / Icinga 1)…

It appears with Icinga2 (& director), I need to state a date range for the repeating interval (“2020-02-19 - 2020-06-24 / 42” = “00:00-24:00”)… THE ONLY EXAMPLE in any documentation for a repeating timeperiod with Icinga 2 is this: “monday 2 february - november 8 / 3” = “00:00-24:00” , which is located here at https://icinga.com/docs/icinga2/latest/doc/09-object-types/#timeperiod and where I noticed it could still work, but only if it was set as a date range instead of open-ended.

I use this old feature to implement a X-person on-call weekly rotation (6-person, then “/ 42”, or 5-person, then “/ 35”), which use to be open-ended, and only needed to be touch if there was changes in personnel, otherwise it could run flawlessly for years (my current configs in a older Icinga 1 system is dated 2016).

Anyone else use repeating timeperiods? I think instead of having to revisit a time range routinely, I was just going to create a rotating oncall contact managed outside of Icinga 2 (likely by cron shell-scripts using aliases in Postfix/sendmail). I would not be very happy having to revisit timeperiods to regularly rewrite just to keep with the new date range instead of open-ended…

Hi,

timeperiods from Nagios / Icinga 1.x are the feature set which lacks proper documentation, it always had only a few examples and one would need to reverse engineer quite a few possibilities from the source code. At least this was the least fun to implement in Icinga 2 years ago to my knowledge.

The repeating interval should work, though I have never used that myself. Inside the source code, that is being called “the stride” - https://github.com/Icinga/icinga2/blob/master/lib/icinga/legacytimeperiod.cpp#L28

Cheers,
Michael

Maybe I should have been more clear that the open-ended/repeating timeperiod produces an error that use to work just fine with version 1, and one can ONLY now use a closed date range for a repeating interval with version 2. The following error is with using Director, but manually creating the timeperiods directly in config produces a similar error, and Icinga will not start.

critical/config: Error: Validation failed for object ‘week1-oncall’ of type ‘TimePeriod’; Attribute ‘ranges’: Invalid time specification ‘2020-03-09 / 42’: Invalid time specification: 2020-03-09

This is a change to how it use to work, and means one will have to routinely rebuild the timeperiod since it is a set time range instead of open-ended.