Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== 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 ==== <code> HOST=* SERVICE=conn SCRIPT /usr/local/sbin/pushRW-xymon.py FORMAT=sms DURATION>5 RECOVERED </code> ===== Source ===== ==== pushover-push.py ==== <hidden onHidden="Show Code ⇲" onVisible="Hide Code ⇱"> <code> #!/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() </code> </hidden> ===== Known Bugs and Issues ===== None ===== To Do ===== None ===== Credits ===== * [[https://pushover.net/api|Pushover API]] ===== Changelog ===== * **2015-09-28** * Initial release alerts/pushover.txt Last modified: 2015/09/28 20:04by pilasguru