Skip to content

Instantly share code, notes, and snippets.

View arawako's full-sized avatar

José Leonel Subero Gamarra arawako

View GitHub Profile
@arawako
arawako / sysnotify.py
Created October 4, 2016 03:40 — forked from sandromello/sysnotify.py
Telegram - sysnotify
#!/usr/bin/env python
import pika, logging, socket, yaml, marshal
from time import sleep
ACCEPTED_KEYS = ['message', 'sla_service', 'site', 'host', 'service']
def send_telegram(data, config):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('localhost', 2391))
if data['sla_service']: