Skip to content

Fix false critical on OMD backup job when check is delayed with more than 30 seconds #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmk/plugins/checkmk/agent_based/mkbackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ def check_mkbackup(job_state: JobData) -> CheckResult:
yield Result(state=State.WARN, summary="Schedule is currently disabled")

elif next_run is not None:
# add a 30 seconds buffer to prevent a critical when the backup is about to start
if next_run < time.time() + 30:
# add a 120 seconds buffer to prevent a critical when the backup is about to start
# 60 seconds in case the check before the backup is delayed and
# 60 seconds in case the mkbackup plugin doesn't update its state
if next_run < time.time() + 120:
state = State.CRIT
else:
state = State.OK
Expand Down