no mention @here if warning
This commit is contained in:
parent
60bb897613
commit
d7cc4c7147
1 changed files with 7 additions and 3 deletions
|
|
@ -150,9 +150,13 @@ def postAlertmanager(chatName):
|
|||
|
||||
|
||||
def send_alert_message(channel, alert):
|
||||
message = "[**{state}**] [{instance}] {amendment}".format(state=alert['status'],
|
||||
message = "[**{state}**] [{instance}] {amendment} {mention}".format(
|
||||
state=alert['status'],
|
||||
instance=alert['labels'].get('instance', 'unknown'),
|
||||
amendment='@here' if alert['status'] == 'firing' else alert['annotations'].get('title'))
|
||||
amendment=alert['annotations'].get('title'),
|
||||
mention='@here' if alert['status'] == 'firing' and alert['labels']['severity'] == 'critical' else ''
|
||||
)
|
||||
|
||||
attach = []
|
||||
|
||||
# attach details if alert is firing
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue