From 2bd60e8562bb71a7327121f4e75986acc28ba532 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 8 May 2024 17:31:29 +0000 Subject: [PATCH] check_send_receive_time: Print no output on success. --- puppet/kandra/manifests/prod_app_frontend_once.pp | 2 +- puppet/kandra/manifests/profile/staging_app_frontend.pp | 2 +- .../nagios_plugins/zulip_app_frontend/check_send_receive_time | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/puppet/kandra/manifests/prod_app_frontend_once.pp b/puppet/kandra/manifests/prod_app_frontend_once.pp index 6ae2469e5e..e53750a1ee 100644 --- a/puppet/kandra/manifests/prod_app_frontend_once.pp +++ b/puppet/kandra/manifests/prod_app_frontend_once.pp @@ -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': diff --git a/puppet/kandra/manifests/profile/staging_app_frontend.pp b/puppet/kandra/manifests/profile/staging_app_frontend.pp index d9700f36c4..78ebb8ffc5 100644 --- a/puppet/kandra/manifests/profile/staging_app_frontend.pp +++ b/puppet/kandra/manifests/profile/staging_app_frontend.pp @@ -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, } } diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time index 50ef47f1cd..e63e8d3c09 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time +++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time @@ -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])