Module: check_mk
Branch: master
Commit: 44dec50075fe2f78fb48afbf5b65821c5486b5ee
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44dec50075fe2f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 18 15:13:17 2014 +0100
#1503 FIX Fixed monitoring of multiple SAP instances with one mk_sap plugin
When monitoring multiple SAP instances from one host by configuring
multiple instances in the sap.cfg, the monitoring of all following
instances was skipped when one single instance had connection
problems.
---
.werks/1503 | 14 ++++++++++++++
ChangeLog | 1 +
agents/plugins/mk_sap | 21 ++++++++++-----------
3 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/.werks/1503 b/.werks/1503
new file mode 100644
index 0000000..061ba8d
--- /dev/null
+++ b/.werks/1503
@@ -0,0 +1,14 @@
+Title: Fixed monitoring of multiple SAP instances with one mk_sap plugin
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1416319927
+
+When monitoring multiple SAP instances from one host by configuring
+multiple instances in the sap.cfg, the monitoring of all following
+instances was skipped when one single instance had connection
+problems.
+
diff --git a/ChangeLog b/ChangeLog
index c55d9c4..cd635e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
* 1437 FIX: veeam_jobs: fixed incorrect state for BackupSync job...
* 1511 FIX: oracle_jobs: avoid broken checks, make compatible with old version...
* 1513 FIX: Handle broken SNMP bulk walk implementation of Mikrotik Router firmware RouterOS v6.22...
+ * 1503 FIX: Fixed monitoring of multiple SAP instances with one mk_sap plugin...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/plugins/mk_sap b/agents/plugins/mk_sap
index 0ce9546..8f867df 100755
--- a/agents/plugins/mk_sap
+++ b/agents/plugins/mk_sap
@@ -221,7 +221,7 @@ def logout():
'INTERFACE': 'XAL',
})
-def mon_list( cfg ):
+def mon_list(cfg):
f = query("BAPI_SYSTEM_MON_GETLIST", {
'EXTERNAL_USER_NAME': cfg['user'],
})
@@ -355,21 +355,16 @@ def process_alerts(cfg, logs, ms_name, mon_name, node, alerts):
-def connect(cfg):
+def check(cfg):
global conn
- try:
- conn = sapnwrfc.base.rfc_connect(cfg)
- except sapnwrfc.RFCCommunicationError, e:
- sys.stderr.write('ERROR: Unable to connect (%s)\n' % e)
- return
-
+ conn = sapnwrfc.base.rfc_connect(cfg)
login()
logs = {}
sap_data = {}
# This loop is used to collect all information from SAP
- for ms_name, mon_name in mon_list( cfg ):
+ for ms_name, mon_name in mon_list(cfg):
path = ms_name + SEPARATOR + mon_name
if not to_be_monitored(path, True):
continue
@@ -455,10 +450,14 @@ def connect(cfg):
logout()
conn.close()
+# It is possible to configure multiple SAP instances to monitor. Loop them all, but
+# do not terminate when one connection failed
for entry in cfg:
try:
- connect(entry)
+ check(entry)
+ except sapnwrfc.RFCCommunicationError, e:
+ sys.stderr.write('ERROR: Unable to connect (%s)\n' % e)
except:
- pass # Make sure that other entries are executed anyway
+ sys.stderr.write('ERROR: Unhandled exception (%s)\n' % e)
sys.exit(0)
Module: check_mk
Branch: master
Commit: 2a7b7594461b066d4d733ab77d5b825450cd4654
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a7b7594461b06…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Nov 18 14:17:12 2014 +0100
#1439 mk-job: now also available on solaris systems
Regarding the mk-job feature itself, you can find more information
<a href="https://mathias-kettner.de/checkmk_job.html">here</a>.
---
.werks/1439 | 12 +++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 30 +++++++++++++++--
agents/mk-job.solaris | 73 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 114 insertions(+), 2 deletions(-)
diff --git a/.werks/1439 b/.werks/1439
new file mode 100644
index 0000000..51d4d76
--- /dev/null
+++ b/.werks/1439
@@ -0,0 +1,12 @@
+Title: mk-job: now also available on solaris systems
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.5i7
+Date: 1416315864
+Class: feature
+
+Regarding the mk-job feature itself, you can find more information
+<a href="https://mathias-kettner.de/checkmk_job.html">here</a>.
+
+
diff --git a/ChangeLog b/ChangeLog
index 3398a48..d32b19d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
1.2.5i7:
Core & Setup:
+ * 1439 mk-job: now also available on solaris systems...
* 1483 FIX: Savely replace illegal vertical bars in check plugin output...
* 1431 FIX: windows_agent: fixed error on parsing unicode formatted logfiles...
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index b5babc3..e8dac81 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -6,7 +6,7 @@
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
-# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
@@ -86,7 +86,7 @@ function run_cached () {
# Cache file outdated and new job not yet running? Start it
if [ -z "$USE_CACHEFILE" -a ! -e "$CACHEFILE.new" ] ; then
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit 1 ; $CMDLINE && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f \"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup bash 2>/dev/null &
+ echo "set -o noclobber ; exec > $CACHEFILE.new || exit 1 ; $CMDLINE && mv $CACHEFILE.new $CACHEFILE || rm -f $CACHEFILE $CACHEFILE.new" | nohup bash 2>/dev/null &
fi
}
@@ -108,6 +108,32 @@ else
fi
+# Get statistics about monitored jobs. Below the job directory there
+# is a sub directory per user that ran a job. That directory must be
+# owned by the user so that a symlink or hardlink attack for reading
+# arbitrary files can be avoided.
+if pushd /var/lib/check_mk_agent/job >/dev/null; then
+ echo '<<<job>>>'
+ for username in *
+ do
+ if [ -d "$username" ] && cd "$username" ; then
+ count=$(su "$username" -c "ls -1 * | wc -l")
+
+ if [ "$count" -eq "1" ]; then
+ filename=$(su "$username" -c "ls -1 *")
+ echo "==> $filename <=="
+ fi
+
+ su "$username" -c "head -n1000 *"
+ cd ..
+ fi
+ done
+ popd > /dev/null
+fi
+
+
+
+
# Filesystem usage for UFS and VXFS
echo '<<<df>>>'
for fs in ufs vxfs samfs lofs
diff --git a/agents/mk-job.solaris b/agents/mk-job.solaris
new file mode 100644
index 0000000..f584b95
--- /dev/null
+++ b/agents/mk-job.solaris
@@ -0,0 +1,73 @@
+#!/bin/bash
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# ails. 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.
+
+help() {
+ echo "Usage: mk-job IDENT PROGRAM [ARGS...]"
+ echo ""
+ echo "Execute PROGRAM as subprocess while measuring performance information"
+ echo "about the running process and writing it to an output file. This file"
+ echo "can be monitored using Check_MK. The Check_MK Agent will forward the"
+ echo "information of all job files to the monitoring server."
+ echo ""
+ echo "This file is being distributed with the Check_MK Agent."
+}
+
+if [ $# -lt 2 ]; then
+ help >&2
+ exit 1
+fi
+
+MYSELF=$(id | awk -F')' '{print $1}' | awk -F'(' '{print $2}')
+OUTPUT_PATH=/var/lib/check_mk_agent/job/$MYSELF
+IDENT=$1
+shift
+
+if [ ! -d "$OUTPUT_PATH" ]; then
+ if [ "$MYSELF" = root ] ; then
+ mkdir -p "$OUTPUT_PATH"
+ else
+ echo "ERROR: Missing output directory $OUTPUT_PATH for non-root user '$MYSELF'." >&2
+ exit 1
+ fi
+fi
+
+if ! type $1 >/dev/null 2>&1; then
+ echo -e "ERROR: Cannot run $1. Command not found.\n" >&2
+ help >&2
+ exit 1
+fi
+
+
+echo "start_time $(perl -e 'print time')" > "$OUTPUT_PATH/$IDENT.running"
+
+info=$((/usr/bin/time -p sh -c "$@ 2>/dev/null 1>&2" 2>&1; echo $?) | sed -e 's/,/\./g');
+RC=$(echo $info | awk '{print $7}')
+
+(echo $info | awk '{print "exit_code "$7"\nreal_time "$2"\nuser_time "$4"\nsystem_time "$6""}') >> "$OUTPUT_PATH/$IDENT.running"
+(echo -e "reads 0\nwrites 0\nmax_res_kbytes 0\navg_mem_kbytes 0\ninvol_context_switches 0\nvol_context_switches 0";) >> "$OUTPUT_PATH/$IDENT.running"
+
+mv "$OUTPUT_PATH/$IDENT.running" "$OUTPUT_PATH/$IDENT"
+exit $RC
+
Module: check_mk
Branch: master
Commit: ecf2f5563b03553a6ec343d4d3caabc40ece28e4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ecf2f5563b0355…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 18 13:33:51 2014 +0100
Fixed exception on user create page
---
web/htdocs/wato.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5b68ffe..c56d451 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11954,7 +11954,7 @@ def mode_edit_user(phase):
html.write(" (%s)" % _("optional"))
html.write("</td></tr><tr><td>%s:</td><td>" % _("Enforce change"))
# Only make password enforcement selection possible when user is allowed to change the PW
- if config.user_may(userid, 'general.edit_profile') and config.user_may(userid, 'general.change_password'):
+ if new or config.user_may(userid, 'general.edit_profile') and config.user_may(userid, 'general.change_password'):
html.checkbox("enforce_pw_change", user.get("enforce_pw_change", False))
html.write(_("Change password at next login or access"))
else:
Module: check_mk
Branch: master
Commit: 1ef58b4976dc552473d175c09af254fe64782ea8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ef58b4976dc55…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 18 11:49:55 2014 +0100
#1501 FIX Legacy view formats created with 2014-09 snapshots are now converted
Views which have been created with Check_MK snapshots from 2014-09 created
the views in a legacy format which the current multisite code can not interpret.
When an installation has such a view created by any user, ist ot usable anymore
and shows an exception like "if 'service' in hide_filters and 'host' in hide_filters:
TypeError: argument of type 'NoneType' is not iterable".
This has been fixed now. The legacy views are now converted automatically.
They are saved in the new format once the user makes his first change to this
or another view.
---
.werks/1501 | 18 ++++++++++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 17 ++++++++++++++---
3 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/.werks/1501 b/.werks/1501
new file mode 100644
index 0000000..c376c52
--- /dev/null
+++ b/.werks/1501
@@ -0,0 +1,18 @@
+Title: Legacy view formats created with 2014-09 snapshots are now converted
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1416307562
+
+Views which have been created with Check_MK snapshots from 2014-09 created
+the views in a legacy format which the current multisite code can not interpret.
+When an installation has such a view created by any user, ist ot usable anymore
+and shows an exception like "if 'service' in hide_filters and 'host' in hide_filters:
+TypeError: argument of type 'NoneType' is not iterable".
+
+This has been fixed now. The legacy views are now converted automatically.
+They are saved in the new format once the user makes his first change to this
+or another view.
diff --git a/ChangeLog b/ChangeLog
index a1d651a..3398a48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,7 @@
* 1496 FIX: Fixed exception after editing a dashboard as user without permission to publish dashboards...
* 1436 FIX: quicksearch: search with multiple patterns (h: / s:) no longer discards the host pattern...
* 1438 FIX: quicksearch: fixed various non-working quicksearch filters...
+ * 1501 FIX: Legacy view formats created with 2014-09 snapshots are now converted...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index d5ce70b..8601980 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -100,9 +100,20 @@ def transform_old_views():
if "context" not in view: # legacy views did not have this explicitly
view.setdefault("user_sortable", True)
- # This tries to map the datasource and additional settings of the
- # views to get the correct view context
- if 'single_infos' not in view:
+ if 'context_type' in view:
+ # This code transforms views from user_views.mk which have been migrated with
+ # daily snapshots from 2014-08 till beginning 2014-10.
+ if view['context_type'] in [ 'host', 'service', 'hostgroup', 'servicegroup' ]:
+ view['single_infos'] = [view['context_type']]
+ else:
+ view['single_infos'] = [] # drop the context type and assume a "multiple view"
+ del view['context_type']
+
+ elif 'single_infos' not in view:
+ # This tries to map the datasource and additional settings of the
+ # views to get the correct view context
+ #
+ # This code transforms views from views.mk (legacy format) to the current format
try:
hide_filters = view.get('hide_filters')
Module: check_mk
Branch: master
Commit: 7be64b4690a3b9996eb37e33d084c1be7df2d844
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7be64b4690a3b9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 18 10:20:53 2014 +0100
Updated bug entries #2204
---
.bugs/2204 | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/.bugs/2204 b/.bugs/2204
new file mode 100644
index 0000000..9047c86
--- /dev/null
+++ b/.bugs/2204
@@ -0,0 +1,14 @@
+Title: Make PNP graphs in notifications user independent
+Component: core
+State: open
+Date: 2014-11-18 10:18:50
+Targetversion: 1.2.5i1
+Class: bug
+
+When using bulk notifications to send mails to a non-contact, the graphs can not
+be fetched from PNP, because there is no user context. This seems to need a patch
+for PNP, because we need to provide a user name which is then checked against
+livestatus for permission on the service or host.
+
+A possible good fix could be to patch pnp that the permission check is disabled
+when executed from command line.