Created
August 12, 2015 12:34
-
-
Save Atala/951bcf828f20a4ad989f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*-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