Last active
August 29, 2015 13:56
-
-
Save migurski/9029667 to your computer and use it in GitHub Desktop.
Engine Light status endpoint script for www.codeforamerica.org
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/env python | |
from json import dumps | |
from time import time | |
try: | |
lib_state = open('/var/run/library-state.txt').read().strip() | |
if lib_state != 'OK': | |
app_state = 'Library: ' + lib_state | |
else: | |
app_state = 'ok' | |
except Exception, e: | |
app_state = 'App: ' + str(e) | |
print 'Content-Type: application/json\n' | |
print dumps({ | |
"status": app_state, | |
"updated": int(time()), | |
"dependencies": ["Github", "Travis-CI", "Amazon RDS"], | |
"resources": [] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment