check_send_receive_time: Print no output on success.

This commit is contained in:
Alex Vandiver 2024-05-08 17:31:29 +00:00 committed by Tim Abbott
parent 294fd914e1
commit 2bd60e8562
3 changed files with 4 additions and 3 deletions

View File

@ -21,7 +21,7 @@ class kandra::prod_app_frontend_once {
zulip::cron { 'check_send_receive_time':
hour => '*',
minute => '*',
command => '/usr/lib/nagios/plugins/zulip_app_frontend/check_send_receive_time --site=https://$(/home/zulip/deployments/current/scripts/get-django-setting NAGIOS_BOT_HOST) >/dev/null',
command => '/usr/lib/nagios/plugins/zulip_app_frontend/check_send_receive_time --site=https://$(/home/zulip/deployments/current/scripts/get-django-setting NAGIOS_BOT_HOST)',
use_proxy => false,
}
zulip::cron { 'check_user_zephyr_mirror_liveness':

View File

@ -22,7 +22,7 @@ class kandra::profile::staging_app_frontend inherits kandra::profile::base {
zulip::cron { 'check_send_receive_time':
hour => '*',
minute => '*',
command => '/usr/lib/nagios/plugins/zulip_app_frontend/check_send_receive_time --site=https://$(/home/zulip/deployments/current/scripts/get-django-setting NAGIOS_BOT_HOST) >/dev/null',
command => '/usr/lib/nagios/plugins/zulip_app_frontend/check_send_receive_time --site=https://$(/home/zulip/deployments/current/scripts/get-django-setting NAGIOS_BOT_HOST)',
use_proxy => false,
}
}

View File

@ -64,7 +64,8 @@ def report(state: str, timestamp: Any = None, msg: Optional[str] = None) -> NoRe
with open(state_file_path + ".tmp", "w") as f:
f.write(f"{now}|{states[state]}|{state}|{msg}\n")
os.rename(state_file_path + ".tmp", state_file_path)
print(f"{state}: {msg}")
if states[state] > 0:
print(f"{state}: {msg}")
sys.exit(states[state])