Module: check_mk
Branch: master
Commit: ffb6bcdc01f7cbce015363522a7054382b9a792c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ffb6bcdc01f7cb…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Mon Jan 28 09:42:38 2019 +0100
mk_jolokia: minor improvement of error handling
We now transport the error output to the check to deal with it,
instead of silently skipping the instance if the jolokia_info
section fails.
Change-Id: I419de0cec2697363c8ce09be5d4091d9543fd18c
---
agents/plugins/mk_jolokia.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/agents/plugins/mk_jolokia.py b/agents/plugins/mk_jolokia.py
index 648bdc9..fb8e86e 100755
--- a/agents/plugins/mk_jolokia.py
+++ b/agents/plugins/mk_jolokia.py
@@ -464,11 +464,11 @@ def query_instance(inst):
def generate_jolokia_info(inst):
# Determine type of server
- data = fetch_var(inst, "version", "")
-
- if not data:
- sys.stderr.write("%s ERROR: Empty server info\n" % inst.name)
- raise SkipInstance()
+ try:
+ data = fetch_var(inst, "version", "")
+ except (SkipInstance, SkipMBean) as exc:
+ yield inst.name, "ERROR", str(exc)
+ raise SkipInstance(exc)
info = data.get('info', {})
version = info.get('version', "unknown")
Module: check_mk
Branch: master
Commit: 52d3751308e8ba8a10fb7f4d6397fe02047570c0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52d3751308e8ba…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Tue Feb 5 09:51:57 2019 +0100
7058 netscaler_vserver: the check is now cluster aware
The check can now be used together with Check_MK clusters.
The cluster behaviour can be defined via the corresponding
WATO rule.
Change-Id: I4dd672a40d5df809add02f2f70d3e9f78cae650e
---
.werks/7058 | 12 ++
checkman/netscaler_vserver | 2 +
checks/netscaler_vserver | 138 +++++++++++++--------
.../wato/check_parameters/netscaler_vserver.py | 43 +++++--
4 files changed, 132 insertions(+), 63 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=52d3751308…
Module: check_mk
Branch: master
Commit: 16d4b4ad9a0e62c4df2cce15afe065af13db472b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=16d4b4ad9a0e62…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Mon Feb 4 09:43:34 2019 +0100
7057 FIX Allow "coding" comment in notification scripts
Notification scripts can contain the name of the notification
script as a comment after the shebang and the optional encoding
comment. When the encoding comment contained only the word
"coding" but not "encoding" the encoding comment was accidentally
used as the title of the notification script. Now the regular
expression from https://docs.python.org/2.7/reference/lexical_analysis.html
is used to recognize encoding comments. Therefore, "coding" and
"encoding" can now be used.
Change-Id: Ieb2151276a57452d75c3f010bbecaffb037becd1
---
.werks/7057 | 18 ++++++++++++++++++
cmk/gui/watolib/user_scripts.py | 3 ++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/7057 b/.werks/7057
new file mode 100644
index 0000000..fc071ee
--- /dev/null
+++ b/.werks/7057
@@ -0,0 +1,18 @@
+Title: Allow "coding" comment in notification scripts
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1549018644
+
+Notification scripts can contain the name of the notification
+script as a comment after the shebang and the optional encoding
+comment. When the encoding comment contained only the word
+"coding" but not "encoding" the encoding comment was accidentally
+used as the title of the notification script. Now the regular
+expression from https://docs.python.org/2.7/reference/lexical_analysis.html
+is used to recognize encoding comments. Therefore, "coding" and
+"encoding" can now be used.
diff --git a/cmk/gui/watolib/user_scripts.py b/cmk/gui/watolib/user_scripts.py
index ba4303c..f38af8c 100644
--- a/cmk/gui/watolib/user_scripts.py
+++ b/cmk/gui/watolib/user_scripts.py
@@ -38,6 +38,7 @@
"""
import os
+import re
import cmk.utils.paths
@@ -76,7 +77,7 @@ def _load_user_scripts_from(adir):
lines = file(path)
lines.next()
line = lines.next().decode("utf-8").strip()
- if line.startswith("#") and "encoding:" in line:
+ if line.startswith("#") and re.search(r'coding[=:]\s*([-\w.]+)', line):
line = lines.next().strip()
if line.startswith("#"):
info["title"] = line.lstrip("#").strip().split("#", 1)[0]