Hi guys. I’ve been reading lots of posts but I’m unable to find a solution to this issue
I just want to check a service once a day between 14:30 and 15:30. However it never gets checked. The service check is always late, I mean always shows negative value:
| Last check | 2d 22h ago | Check Now
| Next check | in -35m 34s | Reschedule |
These are my related config files (Icinga2 version is 2.6.2):
However it’s hard con understand for me how an apparently easy configuration is so hard to get to work.
I’ve been thinking I should be making some kind of configuration mistakes or so …
check only once per day isn’t easy as you have some jitter and drift in the scheduler and if you allow a 1h window and check every 30min you could get 1 or 2 and if you check every 1h then you can get 1 or 0 check results.
If outside of the check window, “Next Check” is negative also on my system.
That is why, for infrequent and precisely timed checks, I recommend to use a external scheduler for submitting of the check result via API or to submit a check now command to avoid drift.
BTW, the jitter and drift is intentional as the scheduler is supposed to space out the checks as much as possible to even the load.
Like @rivad said, 1hcheck_interval in a 1hcheck_period is hit-or-miss.
The check_command is being run, but it’s 50:50 the response will be received withing the check_period.
I would set a 24hcheck_interval, limit it to 1 check a day, and give it a few retires within that 1h window. The below should get you what you’re looking for.
Technically no. The check_interval = 24h will force freshness and help get out of the overdue status quicker.
max_check_attempts limits it to 1 check, but a state change triggers retry_interval.
retry_interval is more about handling a state change, you could clear any issue during the check period. Because it rechecks every 10m. Best used with max_check_attempts.
Hi @dargx - you may be having other causes for negative “next check” times. Check out my first post in this particular portal quite a while ago: Too many late service checks
(Great that your prob has been solved. It’s usual BTW that you mark the oldest post that contains the solution, so that it is shown afterward at the top of the thread after your 1st post. It i.a. tells others that they no longer have to try to help you.)