Module: check_mk
Branch: master
Commit: f19663292a90a8afa1751c46317566fb6e415975
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f19663292a90a8…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Nov 3 15:22:12 2015 +0100
#2446 FIX Active checks check_mail, check_mail_loop: did not work with POP3 protocol
Any mail checks through the POP3 protocol lead to an exception.
This has been fixed.
---
.werks/2446 | 11 +++++++++++
ChangeLog | 1 +
doc/treasures/active_checks/check_mail | 2 +-
doc/treasures/active_checks/check_mail_loop | 2 +-
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/2446 b/.werks/2446
new file mode 100644
index 0000000..ce8140e
--- /dev/null
+++ b/.werks/2446
@@ -0,0 +1,11 @@
+Title: Active checks check_mail, check_mail_loop: did not work with POP3 protocol
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446560378
+
+Any mail checks through the POP3 protocol lead to an exception.
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 312d690..acb20d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* 2672 FIX: mounts: ignore options that are allowed to change on btrfs filesystems...
* 2445 FIX: ibm_svc_disks: fixed crash in case special agent reports too much data columns per line
* 2734 FIX: cmctc.temp: fix exception of type UnicodeDecodeError
+ * 2446 FIX: Active checks check_mail, check_mail_loop: did not work with POP3 protocol...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/doc/treasures/active_checks/check_mail b/doc/treasures/active_checks/check_mail
index 7c2ccf6..8ef4a4a 100755
--- a/doc/treasures/active_checks/check_mail
+++ b/doc/treasures/active_checks/check_mail
@@ -207,7 +207,7 @@ def fetch_mails():
num_messages = len(g_M.list()[1])
for i in range(num_messages):
index = i+1
- lines = g_M.retr(index, 0)[1]
+ lines = g_M.retr(index)[1]
mails[i] = email.message_from_string("".join(lines))
else:
retcode, messages = g_M.search(None, 'NOT', 'DELETED')
diff --git a/doc/treasures/active_checks/check_mail_loop b/doc/treasures/active_checks/check_mail_loop
index c1a0634..c9702ee 100755
--- a/doc/treasures/active_checks/check_mail_loop
+++ b/doc/treasures/active_checks/check_mail_loop
@@ -238,7 +238,7 @@ def fetch_mails():
for i in range(num_messages):
index = i+1
- lines = g_M.retr(index, 0)[1]
+ lines = g_M.retr(index)[1]
mails[i] = email.message_from_string("".join(lines))
else:
Module: check_mk
Branch: master
Commit: 9b3b675bbfdf5ed86ed0d4645115efefcdab69eb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b3b675bbfdf5e…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Nov 3 15:03:17 2015 +0100
#2708 sap, sap_state: new sap_state service reports connection problems to sap hosts
The new sap_state service will be discovered on the host(s) running the sap agent plugin, one service
for each configured host.
This service will report all problems preventing the system from reporting information about the sap
instance.
The remaining sap services will now not become "unknown", but keep their last state and turn stale
after a while.
---
.werks/2708 | 14 ++++++++++++++
ChangeLog | 1 +
agents/plugins/mk_sap | 5 +++++
checkman/sap_state | 18 +++++++++++++++++
checks/sap | 19 ++++++++++++++----
checks/sap_state | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 104 insertions(+), 4 deletions(-)
diff --git a/.werks/2708 b/.werks/2708
new file mode 100644
index 0000000..bb7baee
--- /dev/null
+++ b/.werks/2708
@@ -0,0 +1,14 @@
+Title: sap, sap_state: new sap_state service reports connection problems to sap hosts
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1446559117
+Class: feature
+
+The new sap_state service will be discovered on the host(s) running the sap agent plugin, one service
+for each configured host.
+This service will report all problems preventing the system from reporting information about the sap
+instance.
+The remaining sap services will now not become "unknown", but keep their last state and turn stale
+after a while.
diff --git a/ChangeLog b/ChangeLog
index 5bbea07..312d690 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@
* 2444 lnx_if: now able to detect interfaces which "break" during runtime...
* 2720 nullmailer_mailq: New check for monitoring the outgoing mail queue of Nullmailer...
* 2707 winperf_processor: can now be configured to warn if a single cpu core exceeds a utilization threshold for a while...
+ * 2708 sap, sap_state: new sap_state service reports connection problems to sap hosts...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/agents/plugins/mk_sap b/agents/plugins/mk_sap
index 7303dac..146dcbc 100755
--- a/agents/plugins/mk_sap
+++ b/agents/plugins/mk_sap
@@ -468,11 +468,16 @@ try:
for entry in cfg:
try:
check(entry)
+ sys.stdout.write('<<<sap_state:sep(9)>>>\n%s\tOK\n' % entry['ashost'])
except sapnwrfc.RFCCommunicationError, e:
sys.stderr.write('ERROR: Unable to connect (%s)\n' % e)
+ sys.stdout.write('<<<sap_state:sep(9)>>>\n%s\tUnable to connect (%s)\n' %\
+ (entry['ashost'], e))
processed_all = False
except Exception, e:
sys.stderr.write('ERROR: Unhandled exception (%s)\n' % e)
+ sys.stdout.write('<<<sap_state:sep(9)>>>\n%s\tUnhandled exception (%s)\n' %\
+ (entry['ashost'], e))
processed_all = False
# Now check whether or not an old logfile needs to be removed. This can only
diff --git a/checkman/sap_state b/checkman/sap_state
new file mode 100644
index 0000000..3689db4
--- /dev/null
+++ b/checkman/sap_state
@@ -0,0 +1,18 @@
+title: SAP Host State
+agents: linux
+catalog: app/sap
+license: GPL
+distribution: check_mk
+description:
+ This check reports the state of monitored sap hosts. It turns critical if
+ there is any communication error (including failed login).
+ Please note that this check appears on systems configured to monitor
+ sap instances, that is: the system with the mk_sap agent plugin, whereas
+ the other sap checks appear on a host named after the sap instance.
+
+item:
+ The item name is the hostname of the monitored system.
+
+inventory:
+ The check creates one item for each host configured in sap.cfg
+
diff --git a/checks/sap b/checks/sap
index e508d72..8f165f4 100644
--- a/checks/sap
+++ b/checks/sap
@@ -41,7 +41,7 @@ def inventory_sap_dialog(info):
return inv
def check_sap_dialog(item, params, info):
- # First xtract all infos
+ # First extract all infos
dialog = {}
for line in info:
if line[0] == item and line[3].startswith('SAP CCMS Monitor Templates/Dialog Overview/'):
@@ -51,7 +51,14 @@ def check_sap_dialog(item, params, info):
dialog[key] = perfval, uom
if not dialog:
- return (3, 'Unable to find dialog monitoring data in agent output')
+ # this isn't perfect. Sap data is delivered as piggyback output. Potentially mulitple
+ # hosts can each send data for multiple sap instances. The data can also overlap.
+ # This means technically we may not get here and report then incomplete data if one host is
+ # down.
+ # And we would get here if the host isn't down if the item has simply disappeared from
+ # the output.
+ # There is no way inside this check to determine the host(s) that sent the data in info.
+ raise MKCounterWrapped("no output about sap dialogs in agent output")
def perf_clean_key(s):
return s.replace('(', '_').replace(')', '_').replace(' ', '_').replace('.', '_').rstrip('_')
@@ -124,6 +131,7 @@ def sap_value_path_matches(path, pattern):
def check_sap_value(item, params, info):
status = None
perfdata = []
+
for line in info:
if params.get('limit_item_levels'):
this_path = '/'.join(line[3].split('/')[-params.get('limit_item_levels'):])
@@ -144,7 +152,7 @@ def check_sap_value(item, params, info):
break
if status is None:
- return (3, 'Unable to find the required value in agent output')
+ raise MKCounterWrapped("no output about sap value in agent output")
return (status, output, perfdata)
@@ -199,7 +207,7 @@ def check_sap_value_groups( item, params, info ):
backend = []
count_ok = 0
count_crit = 0
- state = 0
+ state = None
for line in info:
path = line[3]
if item in sap_groups_of_value( path, params ):
@@ -215,6 +223,9 @@ def check_sap_value_groups( item, params, info ):
else:
count_ok += 1
+ if state is None:
+ raise MKCounterWrapped("no output about sap value groups in agent output")
+
return state, "%s OK, %s Crit %s\n%s" % ( count_ok, count_crit, ", ".join(frontend), "\n".join(backend) )
diff --git a/checks/sap_state b/checks/sap_state
new file mode 100644
index 0000000..a9aacc8
--- /dev/null
+++ b/checks/sap_state
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | 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-
+# 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.
+
+
+def inventory_sap_state(info):
+ for node, value in info:
+ yield node, None
+
+
+def check_sap_state(item, _no_parameters, info):
+ def value_to_status(value):
+ if value == "OK":
+ return 0
+ else:
+ return 2
+
+ for node, value in info:
+ if node == item:
+ return value_to_status(value), value
+
+
+check_info['sap_state'] = {
+ "check_function" : check_sap_state,
+ "inventory_function" : inventory_sap_state,
+ "service_description" : "SAP State %s",
+ "has_perfdata" : True,
+}
+
Module: check_mk
Branch: master
Commit: 7fead30e82d7db4319af369ba1dd5ba548161e4f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7fead30e82d7db…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Nov 2 17:19:00 2015 +0100
windows_tasks: Added missing exit codes to be considered okay
---
checks/windows_tasks | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/checks/windows_tasks b/checks/windows_tasks
index b3c551d..7df08bb 100644
--- a/checks/windows_tasks
+++ b/checks/windows_tasks
@@ -41,6 +41,20 @@
# A list of all task state can be found here:
# http://msdn.microsoft.com/en-us/library/aa383604%28VS.85%29.aspx
+
+# From here: http://systemcentercore.com/?GetElement=Custom.TaskScheduler2.Task.LastResu…
+
+# Windows Scheduled Task Last Result Monitor.
+#The monitor checks the last result code (exit code) of a scheduled task.
+#Anything other than the following values is considered a warning condition for an enabled scheduled task.
+#- '0'
+#- '1' (for tasks containing a popup action)
+#- '267009': currently running
+#- '267014': was terminated by user
+#- '267045': queued
+#- '-2147216609': instance of this task already running -> being taken care of by the separate monitor
+#- '-2147750687': task already running -> being taken care of by the separate monitor
+
def windows_tasks_convert(info):
data = {}
last_task = False
@@ -67,16 +81,20 @@ def check_windows_tasks(item, _no_params, info):
state = 0
label = ""
msg = []
- if last_result not in [ 0, 0x00041301, 0x00041325, 0x00041306, 0x8004131F ]: # RUNNING, QUEUED, CANCELD, Instance RUNNING
+ if last_result not in [ 0, 1, 267009, 267014, 267045, -2147216609, -2147750687 ]:
state = 2
label = "(!!)"
msg.append("Service in state: %s%s" % ( last_result, label ) )
- if last_result == 0x00041301:
+ if last_result == 267009:
msg[-1] += " (currently running)"
- elif last_result == 0x00041325:
+ elif last_result == 267014:
+ msg[-1] += " (terminated by user)"
+ elif last_result == 267045:
msg[-1] += " (queued)"
- elif last_result == 0x8004131F:
+ elif last_result == -2147216609:
msg[-1] += " (an instance of the task already running)"
+ elif last_result == -2147750687:
+ msg[-1] += " (task already running)"
if values['Scheduled Task State'] != 'Enabled':
msg.append("Task not Enabled(!!)")
Module: check_mk
Branch: master
Commit: ab0c461aab224d7ff0e5c946fa3aa8bc1136ef7c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab0c461aab224d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 2 16:26:47 2015 +0100
#2722 FIX Fixed some icon links from views opening in dashlet frames instead of the whole page
e.g. the "crashed checks" icon was providing a link which opened the crashed check page
inside a dashlet when clicked on the icon within a dashlet view.
---
.werks/2722 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 4 ++--
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/2722 b/.werks/2722
new file mode 100644
index 0000000..22153da
--- /dev/null
+++ b/.werks/2722
@@ -0,0 +1,10 @@
+Title: Fixed some icon links from views opening in dashlet frames instead of the whole page
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1446477951
+Class: fix
+
+e.g. the "crashed checks" icon was providing a link which opened the crashed check page
+inside a dashlet when clicked on the icon within a dashlet view.
diff --git a/ChangeLog b/ChangeLog
index f6bdea3..6349a05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,7 @@
* 2691 FIX: Fixed exception in host address painter when displaying hosts/services of older sites
* 2670 FIX: Fix problem that no site is configured when user has deleted only site...
* 2717 FIX: Fixed broken webserver level authentication integration (e.g. basic, kerberos)...
+ * 2722 FIX: Fixed some icon links from views opening in dashlet frames instead of the whole page...
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index e571785..4533379 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2557,7 +2557,7 @@ def ajax_popup_action_menu():
url = 'javascript:void(0)'
target = ""
- if target_frame != "_self":
+ if target_frame and target_frame != "_self":
target = " target=\"%s\"" % target_frame
html.write('<a href="%s"%s%s>' % (url, target, onclick))
@@ -2581,4 +2581,4 @@ def sanitize_action_url(url_spec):
if type(url_spec) == tuple:
return url_spec
else:
- return (url_spec, "_self")
+ return (url_spec, None)