def _status(): try: status_array = {} ha = ECMHASocket() for line in ha.get_server_stats(): status_array.setdefault(line['pxname'], {})[line['svname']] = line['status'] return status_array except: raise Exception("Unable to get config")
def cmd_haproxy_stats(self, *argv, **kwargs): """ haproxy.stats[] """ try: ha = ECMHASocket() return { 'stats': ha.get_server_stats(), 'info': ha.get_server_info() } except: raise Exception("Unable to get config")