Module: check_mk
Branch: master
Commit: 8eb1a3e301b7ec4cde0d5474bda64434e7c4f971
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8eb1a3e301b7ec…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jan 8 13:09:13 2014 +0100
FIX postfix_mailq: Linux agent better detects Postfix installation
We new check, if there is really Postfix installed, not just the user.
Also we handle the output of <tt>/usr/sbin/ssmpt</tt>. Thanks to Thomas
Schweikle.
---
.werks/439 | 12 ++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 8 +++++---
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.werks/439 b/.werks/439
new file mode 100644
index 0000000..3ff379e
--- /dev/null
+++ b/.werks/439
@@ -0,0 +1,12 @@
+Title: postfix_mailq: Linux agent better detects Postfix installation
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1389182878
+Targetversion: future
+
+We new check, if there is really Postfix installed, not just the user.
+Also we handle the output of <tt>/usr/sbin/ssmpt</tt>. Thanks to Thomas
+Schweikle.
diff --git a/ChangeLog b/ChangeLog
index 4ccdf7a..82c992e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -77,6 +77,7 @@
* 0399 FIX: check_ftp: cleanup configuration via WATO, remove Hostname field...
* 0435 FIX: esx_vsphere_sensors: Fix garbled output in case of placeholder VMs...
* 0251 FIX: agent_vsphere / check_mk agent: fixed outdated systemtime of check_mk
agent...
+ * 0439 FIX: postfix_mailq: Linux agent better detects Postfix installation...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 1649568..25132f5 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -420,9 +420,11 @@ fi
# Only handle the last 6 lines (includes the summary line at the bottom and
# the last message in the queue. The last message is not used at the moment
# but it could be used to get the timestamp of the last message.
-if type mailq >/dev/null 2>&1 && getent passwd postfix >/dev/null
2>&1; then
- echo '<<<postfix_mailq>>>'
- mailq | tail -n 6
+if type mailq >/dev/null 2>&1 && [ -x /usr/sbin/postfix ] &&
getent passwd postfix >/dev/null 2>&1; then
+ echo '<<<postfix_mailq>>>'
+ mailq | tail -n 6
+elif [ -x /usr/sbin/ssmtp ] ; then
+ mailq 2>&1 | sed 's/^[^:]*: \(.*\)/\1/' | tail -n 6
fi
#Check status of qmail mailqueue