mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
nagios: Don’t crash on missing cron file.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
69a2ad02cd
commit
5050fb19f6
@@ -11,8 +11,14 @@ def nagios_from_file(results_file: str) -> Tuple[int, str]:
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user