Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

bots: Specify realm for nagios bots messages in check_send_receive_time.

Mateusz Mandera57f14b247e45
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 9995d44fbf6..229ae7f77c2 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
@@ -68,7 +68,7 @@ django.setup()
from django.conf import settings
-from zerver.models import get_system_bot
+from zerver.models import get_realm, get_system_bot
states = {
"OK": 0,
@@ -110,16 +110,17 @@ def get_zulips() -> List[Dict[str, Any]]:
return [event["message"] for event in res["events"]]
+internal_realm_id = get_realm(settings.SYSTEM_BOT_REALM).id
if (
"staging" in options.site
and settings.NAGIOS_STAGING_SEND_BOT is not None
and settings.NAGIOS_STAGING_RECEIVE_BOT is not None
):
- sender = get_system_bot(settings.NAGIOS_STAGING_SEND_BOT)
- recipient = get_system_bot(settings.NAGIOS_STAGING_RECEIVE_BOT)
+ sender = get_system_bot(settings.NAGIOS_STAGING_SEND_BOT, internal_realm_id)
+ recipient = get_system_bot(settings.NAGIOS_STAGING_RECEIVE_BOT, internal_realm_id)
else:
- sender = get_system_bot(settings.NAGIOS_SEND_BOT)
- recipient = get_system_bot(settings.NAGIOS_RECEIVE_BOT)
+ sender = get_system_bot(settings.NAGIOS_SEND_BOT, internal_realm_id)
+ recipient = get_system_bot(settings.NAGIOS_RECEIVE_BOT, internal_realm_id)
zulip_sender = zulip.Client(
email=sender.email,