Created
May 31, 2016 05:30
-
-
Save moio/0be28293619f55be976b20f125123e0a to your computer and use it in GitHub Desktop.
Script to check if Taskomatic is up and running
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
#!/usr/bin/python | |
import xmlrpclib, sys, socket | |
TASKO_URL = "http://localhost:2829/RPC2" | |
try: | |
client = xmlrpclib.Server(TASKO_URL) | |
result = client.tasko.one(0) | |
if result == 1: | |
print("Taskomatic is up!") | |
sys.exit(0) | |
except (xmlrpclib.Fault, socket.error): | |
pass | |
print("Taskomatic is down!") | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment