From 00a3709b11423e2d811c4810bdd12b5f2ae9abb1 Mon Sep 17 00:00:00 2001 From: Scott Bronson Date: Fri, 30 Sep 2016 20:29:32 -0700 Subject: [PATCH] add custom DNS records to DNS status checks --- management/status_checks.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/management/status_checks.py b/management/status_checks.py index 4077066a..19c98ec9 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -314,6 +314,20 @@ def run_domain_checks(rounded_time, env, output, pool): for domain in sort_domains(ret, env): ret[domain].playback(output) + run_custom_domain_checks(env, output) + +def run_custom_domain_checks(env, output): + header_pending = True + for qname, rtype, value in get_custom_dns_config(env): + if header_pending: + output.add_heading("Custom") + header_pending = False + result = query_dns(qname, rtype).replace('" "', '') + if value == result or '"' + value + '"' in result: + output.print_ok("Custom %s record is set correctly. [%s ↦ %s]" % (rtype, qname, value)) + else: + output.print_warning("Custom %s record should be set to [%s ↦ %s]" % (rtype, qname, value)) + def run_domain_checks_on_domain(domain, rounded_time, env, dns_domains, dns_zonefiles, mail_domains, web_domains, domains_with_a_records): output = BufferedOutput()