Skip to content
Snippets Groups Projects
Verified Commit 66ce7ebf authored by psy's avatar psy
Browse files

improve rocketchat messages

parent 14503ce3
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment