Module: check_mk
Branch: master
Commit: 9d11033b13f57addd1cbd01ef45933cf51dc59e2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d11033b13f57a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Nov 11 15:36:16 2016 +0100
remove obsolete mk_oracle.solaris
---
agents/plugins/mk_oracle.solaris | 201 ---------------------------------------
1 file changed, 201 deletions(-)
diff --git a/agents/plugins/mk_oracle.solaris b/agents/plugins/mk_oracle.solaris
deleted file mode 100755
index 2bc2ec8..0000000
--- a/agents/plugins/mk_oracle.solaris
+++ /dev/null
@@ -1,201 +0,0 @@
-#!/bin/bash
-# +------------------------------------------------------------------+
-# | ____ _ _ __ __ _ __ |
-# | / ___| |__ ___ ___| | __ | \/ | |/ / |
-# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-# | | |___| | | | __/ (__| < | | | | . \ |
-# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-# | |
-# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
-# +------------------------------------------------------------------+
-#
-# This file is part of Check_MK.
-# The official homepage is at http://mathias-kettner.de/check_mk.
-#
-# check_mk is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation in version 2. check_mk is distributed
-# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
-# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE. See the GNU General Public License for more de-
-# tails. You should have received a copy of the GNU General Public
-# License along with GNU Make; see the file COPYING. If not, write
-# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-# Boston, MA 02110-1301 USA.
-
-# Check_MK agent plugin for monitoring ORACLE databases
-
-# This plugin is a port of the linux agent plugin. It has been
-# tested with solaris 10.
-# This plugin is deprecated. Please use the mk_oracle plugin instead.
-
-# Get list of all running databases
-SIDS=$(UNIX95=true ps -ef -o args | sed -n '/^ora_pmon_/p;/^xe_pmon_/p' | sed -n '/^[a-z]*_pmon_\([^ ]*\)/s//\1/p')
-if [ -z "$SIDS" ] ; then
- # If on this system we've already found a database
- if [ -e "$MK_VARDIR/mk_oracle.found" ] ; then
- echo '<<<oracle_version>>>'
- echo '<<<oracle_sessions>>>'
- echo '<<<oracle_logswitches>>>'
- echo '<<<oracle_tablespaces>>>'
- fi
- exit 0
-fi
-
-touch $MK_VARDIR/mk_oracle.found
-
-# Recreate data if cachefile is older than 120 seconds.
-# If you set this to 0, then the cache file will be created
-# as often as possible. If the database queries last longer
-# then your check interval, caching will be active nevertheless.
-CACHE_MAXAGE=120
-
-# Source the optional configuration file for this agent plugin
-if [ -e "$MK_CONFDIR/mk_oracle.cfg" ]
-then
- . $MK_CONFDIR/mk_oracle.cfg
-fi
-
-# You can specify a list of SIDs to monitor. Those databases will
-# only be handled, if they are found running, though!
-#
-# ONLY_SIDS="XE HIRN SEPP"
-#
-# It is possible to filter SIDS negatively. Just add the following to
-# the mk_oracle.cfg file:
-#
-# EXCLUDE_<sid>="ALL"
-#
-# Another option is to filter single checks for SIDS. Just add
-# lines as follows to the mk_oracle.cfg file. One service per
-# line:
-#
-# EXCLUDE_<sid>="<service>"
-#
-# For example skip oracle_sessions and oracle_logswitches checks
-# for the instance "mysid".
-#
-# EXCLUDE_mysid="sessions logswitches"
-#
-#
-# This check uses a cache file to prevent problems with long running
-# SQL queries. It starts building a cache when
-# a) no cache is present or the cache is too old and
-# b) the cache is not currently being built
-# The cache is used for $CACHE_MAXAGE seconds. The CACHE_MAXAGE
-# option is pre-set to 120 seconds but can be changed in mk_oracle.cfg.
-
-function sqlplus ()
-{
- if OUTPUT=$({ echo 'set pages 0' ; echo 'whenever sqlerror exit 1'; echo 'set lines 8000' ; echo 'set feedback off'; cat ; } | $MK_CONFDIR/sqlplus.sh $1)
- then
- echo "${OUTPUT}" | sed -e 's/[[:space:]]\+/ /g' -e '/^[[:space:]]*$/d' -e "s/^/$1 /"
- else
- echo "${OUTPUT}" | sed "s/^/$1 FAILURE /"
- fi
-}
-
-
-for SID in $SIDS; do
- # Check if SID is listed in ONLY_SIDS if this is used
- if [ "$ONLY_SIDS" ] ; then
- SKIP=yes
- for S in $ONLY_SIDS ; do
- if [ "$S" = "$SID" ] ; then
- SKIP=
- break
- fi
- done
- if [ "$SKIP" ] ; then continue ; fi
- fi
-
- EXCLUDE=EXCLUDE_$SID
- EXCLUDE=${!EXCLUDE}
- # SID filtered totally?
- if [ "$EXCLUDE" = "ALL" ]; then
- continue
- fi
-
- # Do Version-Check (use as a general login check) without caching
- if [ "$EXCLUDE" = "${EXCLUDE/version/}" ]; then
- echo '<<<oracle_version>>>'
- echo "select banner from v\$version where banner like 'Oracle%';" | sqlplus "$SID"
- fi
-
- CACHE_FILE=$MK_VARDIR/oracle_$SID.cache
-
- # Check if file exists and recent enough
- CACHE_FILE_UPTODATE=
- if [ -s $CACHE_FILE ]; then
- NOW=$(perl -le "print time()")
-
- MTIME=$(perl -MPOSIX -le 'print mktime(localtime((lstat($ARGV[0]))[9]))' $CACHE_FILE)
- if [ $(($NOW - $MTIME)) -le $CACHE_MAXAGE ]; then
- CACHE_FILE_UPTODATE=1
- fi
- fi
-
- # If the cache file exists, output it, regardless of its age. If it's outdated
- # then it will be recreated *asynchronously*. It's new contents will not
- # be available here anyway.
- if [ -s "$CACHE_FILE" ] ; then cat "$CACHE_FILE" ; fi
-
- # When the cache file is not valid, we recreated it, but only if there is not
- # yet a background process from a previous check still doing this! We see this
- # because of the existance of the .new file
- # When the cache is old and there is no *new file present, then start a query
- # to update the information for this instance.
- if [ -z "$CACHE_FILE_UPTODATE" -a ! -e "$CACHE_FILE.new" ]
- then
- nohup /bin/bash -c "
- set -o noclobber
- function sqlplus ()
- {
- if OUTPUT=\$({ echo 'set pages 0' ; echo 'whenever sqlerror exit 1'; echo 'set lines 8000' ; echo 'set feedback off'; cat ; } | $MK_CONFDIR/sqlplus.sh \$1)
- then
- echo \"\${OUTPUT}\" | sed -e 's/[[:space:]]\+/ /g' -e '/^[[:space:]]*$/d' -e \"s/^/\$1 /\"
- else
- echo \"\${OUTPUT}\" | sed \"s/^/\$1 FAILURE /\"
- fi
- }
-
- {
- # Only execute checks when not filtered
- if [ '$EXCLUDE' = '${EXCLUDE/sessions/}' ]; then
- echo '<<<oracle_sessions>>>'
- echo \"select count(1) from v\\\$session where status = 'ACTIVE';\" | sqlplus \"$SID\"
- fi
-
- if [ '$EXCLUDE' = '${EXCLUDE/logswitches/}' ]; then
- echo '<<<oracle_logswitches>>>'
- echo \"select count(1) from v\\\$loghist where first_time > sysdate - 1/24;\" | sqlplus \"$SID\"
- fi
-
- if [ '$EXCLUDE' = '${EXCLUDE/tablespaces/}' ]; then
- echo '<<<oracle_tablespaces>>>'
- sqlplus "$SID" <<EOF | sed 's/READ ONLY/READONLY/g'
- select f.file_name, f.tablespace_name, f.status, f.AUTOEXTENSIBLE,
- f.blocks, f.maxblocks, f.USER_BLOCKS, f.INCREMENT_BY,
- f.ONLINE_STATUS, t.BLOCK_SIZE, t.status, decode(sum(fs.blocks), NULL, 0,
- sum(fs.blocks)) free_blocks
- from dba_data_files f, dba_tablespaces t, dba_free_space fs
- where f.tablespace_name = t.tablespace_name
- and f.file_id = fs.file_id(+)
- group by f.file_name, f.tablespace_name, f.status, f.autoextensible,
- f.blocks, f.maxblocks, f.user_blocks, f.increment_by, f.online_status,
- t.block_size, t.status
- UNION
- select f.file_name, f.tablespace_name, f.status, f.AUTOEXTENSIBLE,
- f.blocks, f.maxblocks, f.USER_BLOCKS, f.INCREMENT_BY, 'TEMP',
- t.BLOCK_SIZE, t.status, sum(sh.blocks_free) free_blocks
- from v\\\$thread th, dba_temp_files f, dba_tablespaces t, v\\\$temp_space_header sh
- WHERE f.tablespace_name = t.tablespace_name and f.file_id = sh.file_id
- GROUP BY th.instance, f.file_name, f.tablespace_name, f.status,
- f.autoextensible, f.blocks, f.maxblocks, f.user_blocks, f.increment_by,
- 'TEMP', t.block_size, t.status;
-EOF
- fi
- } > $CACHE_FILE.new && mv $CACHE_FILE.new $CACHE_FILE || rm -f $CACHE_FILE*
- "
- fi
-done
Module: check_mk
Branch: master
Commit: 4a808ab8064c0c5f5db2ded7c3f5d8e957106613
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a808ab8064c0c…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Nov 11 14:51:34 2016 +0100
3963 check_mk_agent.linux: fixed strayed output of postfix status command
---
.werks/3963 | 10 ++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 17 +++++++++++++++--
checks/postfix_mailq_status | 2 +-
4 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/.werks/3963 b/.werks/3963
new file mode 100644
index 0000000..4553b23
--- /dev/null
+++ b/.werks/3963
@@ -0,0 +1,10 @@
+Title: check_mk_agent.linux: fixed strayed output of postfix status command
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1478872023
+
+
diff --git a/ChangeLog b/ChangeLog
index 0d7db06..67a55b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* 3979 FIX: vbox_guest: Only try to fetch VBox state in case the vboxguest module is loaded
* 3750 FIX: cmc_temp: Check now also works when using Nagios core
* 3983 FIX: mssql_instance: Be more robust agains missing instance info in case of connection issues
+ * 3963 FIX: check_mk_agent.linux: fixed strayed output of postfix status command
Multisite:
* 3974 FIX: Sorting comments in hover menu of comments icon by time now
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index e68ebb1..81e5180 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -668,9 +668,22 @@ elif [ -x /usr/sbin/ssmtp ] ; then
fi
# postfix would write to stderr but only if it's a tty
-if type postmulti >/dev/null ; then
+# Another quirk: output would be strayed if not stored
+# in extra variable
+if type postfix >/dev/null ; then
echo "<<<postfix_mailq_status:sep(58)>>>"
- postfix_out=$(script -qfc 'postmulti -p status' /dev/null)
+ 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
+ do
+ if [ -n "$queue_dir" ]; then
+ postfix_out=$(script -qfc "postfix -c $queue_dir status" /dev/null)
+ fi
+ done
+
+ else
+ postfix_out=$(script -qfc 'postfix status' /dev/null)
+ fi
echo $postfix_out
fi
diff --git a/checks/postfix_mailq_status b/checks/postfix_mailq_status
index c8cc56b..c9fad62 100644
--- a/checks/postfix_mailq_status
+++ b/checks/postfix_mailq_status
@@ -58,7 +58,7 @@ def inventory_postfix_mailq_status(parsed):
def check_postfix_mailq_status(item, params, parsed):
if item in parsed:
state_readable = parsed[item]["state"]
- pid = parsed[item].get("pid", "")
+ pid = parsed[item].get("pid")
if state_readable.endswith("is running"):
state = 0
else:
Module: check_mk
Branch: master
Commit: a1b629c3caf4558e63ae848dc187e2eef0d1dc02
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a1b629c3caf455…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 11 14:00:03 2016 +0100
Fixed bug when rendering table views that have joined columns
---
web/plugins/views/layouts.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index 14af441..e05251d 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -637,7 +637,7 @@ def render_grouped_list(rows, view, group_cells, cells, num_columns, show_checkb
# or host - if available - to color the complete line
if num_columns == 1:
# render state, if available through whole tr
- if row.get('service_description', '') == '':
+ if not row.get('service_description'):
state = row.get("host_state", 0)
if state > 0: state +=1 # 1 is critical for hosts
else:
Module: check_mk
Branch: master
Commit: 4719ce95c46e0e5779cce88df517f20fae891baa
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4719ce95c46e0e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 11 12:00:43 2016 +0100
Fixed recent LDAP commit
---
web/plugins/userdb/ldap.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 8eb70c2..e2caf30 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -1017,10 +1017,10 @@ class LDAPUserConnector(UserConnector):
# is increaed by sync plugin) on the local site, so no one needs to active this.
pw_changed = False
if 'ldap_pw_last_changed' in changed:
- changed.remove('ldap_pw_last_changed')
+ del changed['ldap_pw_last_changed']
pw_changed = True
if 'serial' in changed:
- changed.remove('serial')
+ del changed['serial']
pw_changed = True
# Synchronize new user profile to remote sites if needed