mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
bots: Specify realm for nagios bots messages in check_send_receive_time.
This commit is contained in:
committed by
Tim Abbott
parent
104139657b
commit
57f14b247e
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user