#!/usr/bin/env python import check import argparse import logging logging.basicConfig() log = logging.getLogger(None) def do_checks(): checks = [] checks.append(check.DNSCheck("www.ungleich.ch")) checks.append(check.DNSCheck("www.ungleich.ch", expected_result="2a0a:e5c0:0:2:400:b3ff:fe39:795c")) checks.append(check.DNSCheck("www.ungleich.ch", rr_type="A", expected_result="185.203.112.17")) for num_server in range(1,6): server="d{}.ungleich.ch".format(num_server) checks.append(check.DNSCheck("www.ungleich.ch", server=server)) checks.append(check.DFCheck(server)) for c in checks: print("{} {}".format(c, c.check())) if __name__ == "__main__": parser = argparse.ArgumentParser(description='checks') parser.add_argument('--debug', help='Enable debug logging', action='store_true') parser.add_argument('--verbose', help='Enable verbose logging', action='store_true') args = parser.parse_args() if args.debug: log.setLevel(logging.DEBUG) print("dbg") elif args.verbose: log.setLevel(logging.INFO) else: log.setLevel(logging.WARNING) do_checks()