improve rocketchat messages
This commit is contained in:
parent
14503ce330
commit
66ce7ebf0c
1 changed files with 4 additions and 1 deletions
|
|
@ -25,7 +25,10 @@ def postAlertmanager(chatName):
|
|||
try:
|
||||
content = json.loads(request.get_data())
|
||||
for alert in content['alerts']:
|
||||
message = "@here\nStatus: "+alert['status']+"\n"
|
||||
message = ""
|
||||
if alert['status'] == "firing":
|
||||
message += "@here\n "
|
||||
message += "Status: **"+alert['status']+"**\n"
|
||||
if 'name' in alert['labels']:
|
||||
message += "Instance: "+alert['labels'].get('instance', 'unknown')+"("+alert['labels']['name']+")\n"
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue