Icinga executes a service twice within a check-interval

We want to run a service exactly once a day between 20:00 and 20:05 on tuesday and thursday. If the check fails, no retries are to be done (check again only in the next timeframe).
For this we defined a Time-Period:

object TimePeriod "gegen_zwanzig_di_do" {
  import "legacy-timeperiod"
  display_name = "Dienstags und donnerstags gegen acht Uhr abends (20:00)"
  ranges = {
        "tuesday" = "20:00-20:05"
        "thursday" = "20:00-20:05"
        }
}

This definition is used in a service object:

apply Service "aServiceName" {
        check_period = "gegen_zwanzig_di_do" 
        check_interval = 5m
        max_check_attempts = 1
        check_command = "aCommand"
        command_endpoint = host.vars.client_endpoint
        assign where host.name == "myHostName"
}

The “max-check-attempts=1” should block retrying , the time-period is 5 minutes “long” and the check-interval is 5 mins as well.

Despite that definition I see that the check was executed at 20:00:07 and ran successfully. Then is is executed again at 20:04:58 and this one fails. The second execution is unexpected.
Does anybody know whats going on here?
Our architecture: A single master controls a satellite. The check itself is running on a client that is only visible to the satellite. Master, satellite and client are part of a zone.
The master runs on Debian 10, Icinga 2.14.2-1.
Satellite and client run under Debian 12, Icinga 2.13.6-1

Another curious thing is: when I look at the web frontend I see
“Last check: 20:04”
“Next check: 20:09”

This is 5 minutes, but 20:09 is outside the time-period. Shouldn’t we expect a schedule that points to the next defined time-period?

Any ideas are appreciated!
Greetings!

1 Like

espite that definition I see that the check was executed at 20:00:07 and ran successfully. Then is is executed again at 20:04:58 and this one fails

icinga varies the check execution a little bit, that’s the reason why it can get executed again at 20:04:58. try it with check interval =315 and report back please.

Shouldn’t we expect a schedule that points to the next defined time-period

I think that has something to do with the evaluation order but regardless of that info in the gui the check should not run at 20:09 → if it runs report back please.

1 Like

Thanks a lot for the hints.
Concerning the second topic I can say Icinga does not run the test again at 20:09 although it is shown in the GUI. Thats why I more or less considered that to be a cosmetical problem.
Concerning the first topic I will check that out and report back here.
Thanks again!

1 Like

The “315 trick” worked. just one question: it could have been any number greater 5 or lets say 10, just to extend the time frame?

315 is in seconds so it is just above the 5 minutes :slight_smile: