From b3743a31e9309920e40e3780fdfb33a3657400f0 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 15 Jan 2023 08:15:31 -0500 Subject: [PATCH] Add a status checks check that fail2ban is running using fail2ban-client --- management/status_checks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/management/status_checks.py b/management/status_checks.py index 033834dd..b31a9818 100755 --- a/management/status_checks.py +++ b/management/status_checks.py @@ -95,6 +95,12 @@ def run_services_checks(env, output, pool): fatal = fatal or fatal2 output2.playback(output) + # Check fail2ban. + code, ret = shell('check_output', ["fail2ban-client", "status"], capture_stderr=True, trap=True) + if code != 0: + output.print_error("fail2ban is not running.") + all_running = False + if all_running: output.print_ok("All system services are running.")