0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-01-26 02:08:31 +00:00
alerta_alerta/contrib/experimental/alert-blat.py
Nick Satterly d33b1df5b0 stuff
2013-03-05 17:29:08 +00:00

18 lines
No EOL
356 B
Python

import socket
alert = 'test'
stomp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
stomp.connect(('localhost', 61613))
stomp.send('CONNECT\n\n\x00')
recv = stomp.recv(4096)
if 'CONNECTED' in recv:
stomp.send('SEND\ndestination:%s\n\n' % '/queue/test')
stomp.send(alert)
stomp.send('\x00')
else:
print('Connection problem')