From c1e4e33415b8443792a96cd876723887d09361a8 Mon Sep 17 00:00:00 2001 From: Justus Wingert Date: Tue, 15 Aug 2023 14:28:46 +0200 Subject: [PATCH] Added status checks for the configuration files. --- management/status_checks.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/management/status_checks.py b/management/status_checks.py index b31a9818..6a25f0de 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -333,6 +333,18 @@ def run_domain_checks(rounded_time, env, output, pool, domains_to_check=None): # Get the list of domains we serve HTTPS for. web_domains = set(get_web_domains(env)) + output.add_heading("nginx configuration files") + + # Check nginx configuration. + sites_enabled = shell("check_output", ["ls", "/etc/nginx/sites-enabled"]) + output.print_ok("Checking domain configuration files: %s" % sites_enabled) + for domain in web_domains: + prefixed_domain = "miab_%s" % domain + if prefixed_domain in sites_enabled: + output.print_ok("Domain checked. (%s)" % domain) + else: + output.print_error("A domain configuration file is not enabled in nginx (%s)" % domain) + if domains_to_check is None: domains_to_check = mail_domains | dns_domains | web_domains