Module: check_mk
Branch: master
Commit: fac982ec97a316598bc03a8b391612e1108dfb4f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fac982ec97a316…
Author: Roland Halbig <rh(a)mathias-kettner.de>
Date: Tue Mar 28 09:58:05 2017 +0200
Removed debug message in availability.
Change-Id: Icd5abf3c3214e13bc0074eca124a4fe24006621d
---
web/plugins/views/availability.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index 31ae65f..b41934a 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -609,8 +609,6 @@ def render_bi_availability(title, aggr_rows):
timewarpcode = html.drain()
- html.write_text("LOL%sLOL" % type(htmlcode))
-
# Note: 'spans_by_object' returns two arguments which are used by
# all availability views but not by BI. There we have to take
# only complete aggregations
Module: check_mk
Branch: master
Commit: f46f1d73e0b68ab3bfc466705cf0b6ead88712d0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f46f1d73e0b68a…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Mar 22 17:24:16 2017 +0100
4547 FIX check_mk_agent.linux: Fixed agent section which spammed in utmp of RHEL/CentOS
The section postfix_mailq_status was writing into utmp everytime the agent
run. With the new version we are able to avoid this behaviour and still get
informations about multiple instances of postfix.
Change-Id: I31961f6879cb2f04a7760bc7ccb209342f4e6b96
---
.werks/4547 | 15 +++++++++++++++
agents/check_mk_agent.linux | 26 +++++++++++---------------
2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/.werks/4547 b/.werks/4547
new file mode 100644
index 0000000..094c9bb
--- /dev/null
+++ b/.werks/4547
@@ -0,0 +1,15 @@
+Title: check_mk_agent.linux: Fixed agent section which spammed in utmp of RHEL/CentOS
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1490199589
+Class: fix
+
+The section postfix_mailq_status was writing into utmp everytime the agent
+run. With the new version we are able to avoid this behaviour and still get
+informations about multiple instances of postfix.
+
+This fix needs an updated agent AND an updated checkplugin but a rediscovery
+is not neccessary.
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 4e1ec35..80c5413 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -684,28 +684,24 @@ elif [ -x /usr/sbin/ssmtp ] ; then
fi
-# postfix would write to stderr but only if it's a tty
-# Another quirk: output would be strayed if not stored
-# in extra variable
+# Postfix status monitoring. Can handle multiple instances.
if type postfix >/dev/null ; then
echo "<<<postfix_mailq_status:sep(58)>>>"
- multi_instances_dirs=$(postconf -c /etc/postfix 2>/dev/null | grep ^multi_instance_directories | sed 's/.*=[[:space:]]*//g')
- if [ ! -z "$multi_instances_dirs" ]; then
- for queue_dir in $multi_instances_dirs
+ for i in $(ls -d /var/spool/postfix*)
do
- if [ -n "$queue_dir" ]; then
- postfix_out=$(script -qfc "postfix -c $queue_dir status" /dev/null)
- echo $postfix_out
+ if [ -e "$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) == *"postfix/master"* ]]; then
+ echo "$i: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'
+ fi
+ else
+ echo "$i:not running" | sed 's/\/var\/spool\///g'
fi
done
-
- else
- postfix_out=$(script -qfc 'postfix status' /dev/null)
- echo $postfix_out
- fi
fi
-
# Check status of qmail mailqueue
if type qmail-qstat >/dev/null
then