MCPcopy Create free account
hub / github.com/Icinga/icinga2 / IsLikelyToBeCheckedSoon

Method IsLikelyToBeCheckedSoon

lib/icinga/checkable-notification.cpp:318–334  ·  view source on GitHub ↗

* E.g. we're going to re-send a stashed problem notification as *this is still not ok. * But if the next check result recovers *this soon, we would send a recovery notification soon after the problem one. * This is not desired, especially for lots of checkables at once. * Because of that if there's likely to be a check result soon, * we delay the re-sending of the stashed notification until th

Source from the content-addressed store, hash-verified

316 * @return Whether *this is likely to be checked soon
317 */
318bool Checkable::IsLikelyToBeCheckedSoon()
319{
320 if (!GetEnableActiveChecks()) {
321 return false;
322 }
323
324 // One minute unless the check interval is too short so the next check will always run during the next minute.
325 auto threshold (GetCheckInterval() - 10);
326
327 if (threshold > 60) {
328 threshold = 60;
329 } else if (threshold < 0) {
330 threshold = 0;
331 }
332
333 return GetNextCheck() <= Utility::GetTime() + threshold;
334}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected