Skip to content

Instantly share code, notes, and snippets.

@sargun
Created September 12, 2012 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sargun/3708925 to your computer and use it in GitHub Desktop.
Save sargun/3708925 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import yaml, os
dropwizard_services = ['streamie', 'mugshot']
class dropwizard_healthcheck(object):
def __init__(self, servicename):
def main():
has_services = []
healthchecks = []
config_file = '/etc/%s.yml'
for service_name in dropwizard_services:
if os.access(config_file % service_name, os.R_OK):
has_services.append(service_name)
for service_name in has_services:
healthchecks.append(dropwizard_healthcheck(service_name))
for healthcheck in healthchecks:
healthcheck.healthcheck()
#Render / print
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment