mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
webhooks/zabbix: Improve message formatting and punctuation.
This commit is contained in:
@@ -15,7 +15,7 @@ class ZabbixHookTests(WebhookTestCase):
|
||||
Tests if zabbix alert is handled correctly
|
||||
"""
|
||||
expected_topic = u"www.example.com"
|
||||
expected_message = u"PROBLEM (Average) alert on [www.example.com](https://zabbix.example.com/tr_events.php?triggerid=14032&eventid=10528).\nZabbix agent on www.example.com is unreachable for 5 minutes\nAgent ping is Up (1)"
|
||||
expected_message = u"PROBLEM (Average) alert on [www.example.com](https://zabbix.example.com/tr_events.php?triggerid=14032&eventid=10528):\n* Zabbix agent on www.example.com is unreachable for 5 minutes\n* Agent ping is Up (1)"
|
||||
self.send_and_test_stream_message('zabbix_alert', expected_topic, expected_message)
|
||||
|
||||
def test_zabbix_invalid_payload_with_missing_data(self) -> None:
|
||||
|
||||
@@ -20,7 +20,11 @@ need further help!
|
||||
"""
|
||||
|
||||
ZABBIX_TOPIC_TEMPLATE = '{hostname}'
|
||||
ZABBIX_MESSAGE_TEMPLATE = '{status} ({severity}) alert on [{hostname}]({link}).\n{trigger}\n{item}'
|
||||
ZABBIX_MESSAGE_TEMPLATE = """
|
||||
{status} ({severity}) alert on [{hostname}]({link}):
|
||||
* {trigger}
|
||||
* {item}
|
||||
""".strip()
|
||||
|
||||
@api_key_only_webhook_view('Zabbix')
|
||||
@has_request_variables
|
||||
|
||||
Reference in New Issue
Block a user