From 97b451b44311fd22f961f78b85fc543c495cb613 Mon Sep 17 00:00:00 2001 From: "Felix J. Ogris" Date: Wed, 7 Aug 2024 22:28:13 +0200 Subject: [PATCH 1/2] Added support for DragonFly BSD Mail Agent (dma) --- agents/check_mk_agent.freebsd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd index 6e2f6506070..4f4caf80558 100755 --- a/agents/check_mk_agent.freebsd +++ b/agents/check_mk_agent.freebsd @@ -561,6 +561,14 @@ run_purely_synchronous_sections() { elif [ -x /usr/sbin/ssmtp ]; then echo '<<>>' mailq 2>&1 | sed 's/^[^:]*: \(.*\)/\1/' | tail -n 6 + elif [ -x /usr/libexec/dma ]; then + # Check status of DragonFly BSD Mail Agent (dma) + echo '<<>>' + /usr/libexec/dma -bp | tail -n 7 + dma_count=$(/usr/libexec/dma -bp | grep "^ID" | wc -l) + if [ "${dma_count}" -gt 0 ]; then + echo "${dma_count} Requests." + fi fi # Check status of qmail mailqueue From f15860c36213e09cdbc7f95d905f92306160df22 Mon Sep 17 00:00:00 2001 From: "Felix J. Ogris" Date: Sun, 25 Aug 2024 23:20:47 +0200 Subject: [PATCH 2/2] dma mailq tested against recent version of Checkmk --- agents/check_mk_agent.freebsd | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd index 4f4caf80558..c0faa039b92 100755 --- a/agents/check_mk_agent.freebsd +++ b/agents/check_mk_agent.freebsd @@ -564,11 +564,8 @@ run_purely_synchronous_sections() { elif [ -x /usr/libexec/dma ]; then # Check status of DragonFly BSD Mail Agent (dma) echo '<<>>' - /usr/libexec/dma -bp | tail -n 7 - dma_count=$(/usr/libexec/dma -bp | grep "^ID" | wc -l) - if [ "${dma_count}" -gt 0 ]; then - echo "${dma_count} Requests." - fi + echo -n QUEUE_deferred + /usr/libexec/dma -bp | grep ^ID | wc -l fi # Check status of qmail mailqueue