====== PushOver (conn alert) ======
^ Author | [[ rodolfo@pilas.guru | pilasguru ]] |
^ Compatibility | Xymon 4.2 |
^ Requirements | python, python-httplib2 |
^ Download | None |
^ Last Update | 2015-09-28 |
===== Description =====
This script notice [[https://pushover.net/|Pushover]] service about **conn** monitor status.
===== Installation =====
==== /etc/hobbit/hobbit-alerts.cfg ====
HOST=* SERVICE=conn
SCRIPT /usr/local/sbin/pushRW-xymon.py FORMAT=sms DURATION>5 RECOVERED
===== Source =====
==== pushover-push.py ====
#!/usr/bin/python
USER_KEY = 'fu8V........g8Mn'
APP_TOKEN= 'amf536k........EVNr33S8'
import sys, os, httplib, urllib
if os.environ.get('RECOVERED') != "1":
msg = " Down"
else:
msg = " Up, " + os.environ.get('DOWNSECSMSG','0') + "s "
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": APP_TOKEN,
"user": USER_KEY,
"message": os.environ.get('BBHOSTSVC','host.test') + " " + msg,
}), { "Content-type": "application/x-www-form-urlencoded" })
conn.getresponse()
===== Known Bugs and Issues =====
None
===== To Do =====
None
===== Credits =====
* [[https://pushover.net/api|Pushover API]]
===== Changelog =====
* **2015-09-28**
* Initial release