Module: check_mk
Branch: master
Commit: 0bf102db5699bd89fb36621fae640ae902b3b04d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0bf102db5699bd…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Dec 28 13:55:32 2017 +0100
5598 FIX postfix_mailq_status: Fix Linux agent to handle newer SuSE systems
Postfixes master executable can be found under postfix/sbin or postfix/bin
depending on the system. The latter case had not been handled by the agent.
This has been fixed.
Thanks to Robert Sander for the patch!
Change-Id: Ie88e80527d83b9a8f421c989d2aa299e85da1efc
---
.werks/5598 | 15 +++++++++++++++
agents/check_mk_agent.linux | 2 +-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/5598 b/.werks/5598
new file mode 100644
index 0000000..ceba293
--- /dev/null
+++ b/.werks/5598
@@ -0,0 +1,15 @@
+Title: postfix_mailq_status: Fix Linux agent to handle newer SuSE systems
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i3
+Date: 1514465574
+
+Postfixes master executable can be found under postfix/sbin or postfix/bin
+depending on the system. The latter case had not been handled by the agent.
+This has been fixed.
+
+Thanks to Robert Sander for the patch!
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index ebe697a..8354e1a 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -694,7 +694,7 @@ if type postfix >/dev/null ; then
if [ -e "$i/pid/master.pid" ]; then
if [ -r "$i/pid/master.pid" ]; then
postfix_pid=$(cat $i/pid/master.pid | sed 's/ //g') # handle
possible spaces in output
- if readlink -- "/proc/$postfix_pid/exe" | grep -q
".*postfix/\(sbin/\)\?master.*"; then
+ if readlink -- "/proc/$postfix_pid/exe" | grep -q
".*postfix/\(s\?bin/\)\?master.*"; then
echo "$i:the Postfix mail system is
running:PID:$postfix_pid" | sed 's/\/var\/spool\///g'
else
echo "$i:PID file exists but instance is not running!"
| sed 's/\/var\/spool\///g'