mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +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
|
This file is created by various nagios checking cron jobs such as
|
||||||
check-rabbitmq-queues and check-rabbitmq-consumers"""
|
check-rabbitmq-queues and check-rabbitmq-consumers"""
|
||||||
|
|
||||||
|
try:
|
||||||
with open(results_file) as f:
|
with open(results_file) as f:
|
||||||
data = f.read().strip()
|
data = f.read().strip()
|
||||||
|
except FileNotFoundError:
|
||||||
|
state = 'UNKNOWN'
|
||||||
|
ret = 3
|
||||||
|
data = "Results file is missing"
|
||||||
|
else:
|
||||||
pieces = data.split('|')
|
pieces = data.split('|')
|
||||||
|
|
||||||
if not len(pieces) == 4:
|
if not len(pieces) == 4:
|
||||||
|
|||||||
Reference in New Issue
Block a user