From ca8ba84e6593d70bc58a0c91675deec374d0e799 Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Wed, 6 May 2026 07:39:55 -0400 Subject: [PATCH] fix: silence aiohttp.access log and strip plugin prefix in alerts UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main: disable aiohttp.access propagation unless --debug is active - alerts.html: strip plugin-name prefix from metric_path display (nagios_runner.check_disk_root_status_code → check_disk_root_status_code) Co-Authored-By: Claude Sonnet 4.6 --- hbd/server/main.py | 3 ++- hbd/server/templates/alerts.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hbd/server/main.py b/hbd/server/main.py index 42f5f20..179c8c5 100644 --- a/hbd/server/main.py +++ b/hbd/server/main.py @@ -475,7 +475,8 @@ def run(config, config_path=None): if config.get("debug", 0) > 0: log_level = logging.DEBUG logging.basicConfig(level=log_level) - logging.getLogger("aiohttp.access").setLevel(logging.DEBUG) + if not config.get("debug", 0): + logging.getLogger("aiohttp.access").propagate = False load_pickled_hosts(config, hbdclass) notify_mod.initlog(logfile=config.get("logfile", "messages.log")) diff --git a/hbd/server/templates/alerts.html b/hbd/server/templates/alerts.html index 733b231..5fd941d 100644 --- a/hbd/server/templates/alerts.html +++ b/hbd/server/templates/alerts.html @@ -439,7 +439,7 @@ ${alert.level} ${alert.hostname} -
${alert.metric_path}
+
${alert.metric_path.includes('.') ? alert.metric_path.slice(alert.metric_path.indexOf('.') + 1) : alert.metric_path}
${valueText} Active for ${duration}