Skip to content

Instantly share code, notes, and snippets.

@yosida95
Last active May 15, 2017 15:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yosida95/520ef6d76b1ef8215736 to your computer and use it in GitHub Desktop.
Save yosida95/520ef6d76b1ef8215736 to your computer and use it in GitHub Desktop.
contacts pushover
contact.pushover.command /path/to/pushover_munin.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import urllib2
from urllib import urlencode
APPTOKEN = YOUR_APPLICATION_TOKEN
USERTOKEN = YOUR_USER_TOKEN
def main():
message = sys.stdin.read()
params = dict(
token=APPTOKEN,
user=USERTOKEN,
message=message)
request = urllib2.Request(url='https://api.pushover.net/1/messages.json',
data=urlencode(params))
urllib2.urlopen(request)
return 0
if __name__ == u'__main__':
sys.exit(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment