This commit is contained in:
nd 2024-05-20 16:18:38 +02:00
commit 27f1b558df

View file

@ -150,9 +150,13 @@ def postAlertmanager(chatName):
def send_alert_message(channel, alert):
message = "[**{state}**] [{instance}] {amendment}".format(state=alert['status'],
instance=alert['labels'].get('instance', 'unknown'),
amendment='@here' if alert['status'] == 'firing' else alert['annotations'].get('title'))
message = "[**{state}**] [{instance}] {amendment} {mention}".format(
state=alert['status'],
instance=alert['labels'].get('instance', 'unknown'),
amendment=alert['annotations'].get('title'),
mention='@here' if alert['status'] == 'firing' and alert['labels']['severity'] == 'critical' else ''
)
attach = []
# attach details if alert is firing