def home(request): plugins, working = get_plugins() if working: return HttpResponse(loader.render_to_string("health_check/dashboard.html", {'plugins': plugins})) else: return HttpResponseServerError(loader.render_to_string("health_check/dashboard.html", {'plugins': plugins}))
def handle(self, *args, **options): plugins, working = get_plugins() sys.stdout.write("Running Health checks\n") for plugin in plugins: sys.stdout.write("Running Health check - %s\n" % str(plugin.identifier())) sys.stdout.write("Result - %s\n" % str(plugin.pretty_status()))
def yamlhealthcheck(request): plugins, working = get_plugins() health_check_status = {} for plugin in plugins: health_check_status[str(plugin.identifier())] = str(plugin.pretty_status()) health_check_yaml = yaml.dump(health_check_status) return HttpResponse(health_check_yaml, content_type='application/x-yaml')
def jsonhealthcheck(request): plugins, working = get_plugins() health_check_status = {} for plugin in plugins: health_check_status[str(plugin.identifier())] = str(plugin.pretty_status()) health_check_json = json.dumps(health_check_status) return HttpResponse(health_check_json, content_type='application/json')
def yamlhealthcheck(request): plugins, working = get_plugins() health_check_status = {} for plugin in plugins: health_check_status[str(plugin.identifier())] = str( plugin.pretty_status()) health_check_yaml = yaml.dump(health_check_status) return HttpResponse(health_check_yaml, content_type='application/x-yaml')
def jsonhealthcheck(request): plugins, working = get_plugins() health_check_status = {} for plugin in plugins: health_check_status[str(plugin.identifier())] = str( plugin.pretty_status()) health_check_json = json.dumps(health_check_status) return HttpResponse(health_check_json, content_type='application/json')
def home(request): plugins, working = get_plugins() if working: return HttpResponse( loader.render_to_string("health_check/dashboard.html", {'plugins': plugins})) else: return HttpResponseServerError( loader.render_to_string("health_check/dashboard.html", {'plugins': plugins}))
def texthealthcheck(request): plugins, working = get_plugins() health_check_statuses = {} for plugin in plugins: health_check_statuses[str(plugin.identifier())] = str(plugin.pretty_status()) health_check_status_text = '' for health_check_status_key,health_check_status_value in health_check_statuses.items(): health_check_status_text+='%s\t%s\n' % (health_check_status_key,health_check_status_value) return HttpResponse(health_check_status_text, content_type='text/plain')
def texthealthcheck(request): plugins, working = get_plugins() health_check_statuses = {} for plugin in plugins: health_check_statuses[str(plugin.identifier())] = str( plugin.pretty_status()) health_check_status_text = '' for health_check_status_key, health_check_status_value in health_check_statuses.items( ): health_check_status_text += '%s\t%s\n' % (health_check_status_key, health_check_status_value) return HttpResponse(health_check_status_text, content_type='text/plain')