def get_removed_hosts(self): if not self.dynamic_hosts: return [] ret = [] for check in self.checks_state: if check['CheckID'] == 'serfHealth': status = Status.from_string(check['Status']) if status is Status.critical: host = self.resolve_host(check['Node']) ret.append(host) return ret
def get_check_results(self): ret = [] for check in self.checks_state: output, metrics = parse_nagios_output(check['Output']) status = Status.from_string(check['Status']) host = self.resolve_host(check['Node']) check_dict = { 'name': check['CheckID'], 'host': host, 'status': status, 'output': output, 'metrics': metrics, } ret.append(check_dict) return ret