adamant-kite-43734
04/04/2024, 4:30 PMechoing-apple-85428
04/05/2024, 7:45 AMancient-pizza-13099
04/05/2024, 9:01 AMancient-pizza-13099
04/05/2024, 9:02 AMancient-pizza-13099
04/05/2024, 9:03 AMServiceNow
, I did not test them before. What's your current configuration of clusterflow/clusteroutput
?echoing-apple-85428
04/05/2024, 9:10 AMechoing-apple-85428
04/05/2024, 9:11 AMancient-pizza-13099
04/05/2024, 9:14 AMancient-pizza-13099
04/05/2024, 9:14 AMechoing-apple-85428
04/05/2024, 9:20 AMancient-pizza-13099
04/05/2024, 9:35 AM```
alert-webhookserver.py
import web
import json
from datetime import datetime
urls = ('/.*', 'hooks')
app = web.application(urls, globals())
def printAlert(jo):
for x in jo["alerts"]:
print(x)
print()
class hooks:
def POST(self):
data = web.data().decode("utf-8")
jo = json.loads(data)
print('DATA RECEIVED: len:'+str(len(data)) +" :contains:"+str(len(jo["alerts"])) +" alerts: " +str(datetime.now()))
printAlert(jo)
print(jo)
print()
return 'OK'
if __name__ == '__main__':
# usage
# export PORT=8090 or any, default is 8080
print("start a simple webhook server to receive alert " + str(datetime.now()))
app.run()
$ python3 alert-webhookserver.py
start a simple webhook server to receive alert 2022-08-29 19:39:25.847186
<http://0.0.0.0:8090/>
```
ancient-pizza-13099
04/05/2024, 9:35 AMancient-pizza-13099
04/05/2024, 9:36 AMancient-pizza-13099
04/05/2024, 9:36 AMping
your simple server's IPancient-pizza-13099
04/05/2024, 9:48 AMechoing-apple-85428
04/05/2024, 10:11 AM