mirror of https://github.com/zulip/zulip.git
check_cron_file: Don't crash on missing cron file.
This is5050fb19f6
, but for `check_cron_file`, which was introduced in91da4bd59b
.
This commit is contained in:
parent
8fbde9b8c5
commit
41b7ae4e44
|
@ -16,8 +16,14 @@ def nagios_from_file(results_file: str, max_time_diff: int = 60 * 2) -> "Tuple[i
|
|||
This file is created by various nagios checking cron jobs such as
|
||||
check-rabbitmq-queues and check-rabbitmq-consumers"""
|
||||
|
||||
try:
|
||||
with open(results_file) as f:
|
||||
data = f.read().strip()
|
||||
except FileNotFoundError:
|
||||
state = "UNKNOWN"
|
||||
ret = 3
|
||||
data = "Results file is missing"
|
||||
else:
|
||||
pieces = data.split("|")
|
||||
|
||||
if not len(pieces) == 4:
|
||||
|
|
Loading…
Reference in New Issue