Skip to content

Instantly share code, notes, and snippets.

@moio
Created May 31, 2016 05:30
Show Gist options
  • Save moio/0be28293619f55be976b20f125123e0a to your computer and use it in GitHub Desktop.
Save moio/0be28293619f55be976b20f125123e0a to your computer and use it in GitHub Desktop.
Script to check if Taskomatic is up and running
#!/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