Skip to content

Instantly share code, notes, and snippets.

@Atala
Created Aug 12, 2015
Embed
What would you like to do?
# -*-coding:utf-8-*-
#!/usr/bin/env python
import flowdock
import argparse
FLOWDOCK_API_KEY = "XXXX"
FLOWDOCK_USERNAME = "Monit"
FLOWDOCK_TAGS = ["#alert"]
chat = flowdock.Chat(FLOWDOCK_API_KEY)
def main():
parser = argparse.ArgumentParser(description='Post monit alert to flow dock.')
parser.add_argument('-m', '--message',
help='name of the concerned service')
args = parser.parse_args()
print u"Posting %r..." % (args.message, )
chat.post(args.message, FLOWDOCK_USERNAME, FLOWDOCK_TAGS)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment