Only send title to Matrix
This commit is contained in:
parent
041eef2a7d
commit
0af95a105b
1 changed files with 3 additions and 4 deletions
|
|
@ -41,10 +41,9 @@ async def send_message(text):
|
||||||
|
|
||||||
async def handle_alert(request):
|
async def handle_alert(request):
|
||||||
body = await request.json()
|
body = await request.json()
|
||||||
for alert in body['alerts']:
|
title = body['title']
|
||||||
status = alert['status']
|
status = body['status']
|
||||||
name = alert['labels']['alertname']
|
await send_message(f'[{status}] {title}')
|
||||||
await send_message(f'[{status}] {name}')
|
|
||||||
return web.Response(text='Ok')
|
return web.Response(text='Ok')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue