How to settings TimePeriod for one service?

I set custom time period in the timeperiods.conf:

object TimePeriod "18to23" {
  display_name = "18-23h"
  ranges = {
    "monday"    = "18:00-23:00"
    "tuesday"   = "18:00-23:00"
    "wednesday" = "18:00-23:00"
    "thursday"  = "18:00-23:00"
    "friday"    = "18:00-23:00"
    "saturday"  = "18:00-23:00"
    "sunday"    = "18:00-23:00"
  }
}

Then edited service.conf:

apply Service "testemail" {
   import "1hour-service"
   check_period = "18to23"
   check_command = "testemail"
   display_name = "test-email"
   assign where match("ISP-Tele*", host.display_name)
}

Then I restarted icinga. Now if I watch the icingaweb, the I see the next check message is: in 58m 10s, but now 1pm, so the next check should be in 5 hours because then it will be 6pm. What is wrong?

wait and check if check gets executed, I read something similar in the forum some time ago and i think the checkexecution window will be checked one more time.

And where do you log when you start a request? Because I don’t see any requests in /var/log/icinga2/icinga2.log

That is only visible in the debug log.
Be careful when enabling it, as it grows rapidly. And make sure to disable it (and restart the icinga service) again.

Thx, now I see. Working great:

[2023-07-11 11:57:28 +0200] notice/CheckerComponent: Skipping check for object ‘isp.server.com!testemail’: not in check period ‘18to23’
[2023-07-11 11:57:28 +0200] debug/CheckerComponent: Checks for checkable ‘isp.server.com!testemail’ are disabled. Rescheduling check.

the next check time does not print the real time, but what is in the check template, and then compares it with the timeperiod, so if you should check every minute, it checks every minute and finds that you cannot do it because of the timeperiod. This is a pretty stupid solution…