Module: check_mk
Branch: master
Commit: 0ffc94e071e43cac3c7d75b198e1f819e5ec0473
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0ffc94e071e43c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 13:28:22 2013 +0100
Updated bug entries #0893
---
.bugs/893 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.bugs/893 b/.bugs/893
index d19bebf..2fe4513 100644
--- a/.bugs/893
+++ b/.bugs/893
@@ -1,9 +1,9 @@
Title: Disable view-reload in after-command-situation
Component: multisite
-State: open
+Class: nastiness
+State: done
Date: 2013-06-13 12:05:04
Targetversion: 1.2.3
-Class: nastiness
If you issue a command on an object you come to a page
with a blue message and a link back to the view.
@@ -13,3 +13,5 @@ If the reload happens the view data appears, but shouldn't
The command button is still disabled.
Disable view reload here.
+
+2013-12-18 13:28:13: changed state open -> done
Module: check_mk
Branch: master
Commit: 8c27471581e3f6385fc495798301492e533cda20
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c27471581e3f6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 13:25:38 2013 +0100
FIX Tolerate debug output in check plugins when using CMC
When using the Check_MK Micro Core and at the same time check plugins output
debug information to stdout, the communication with the core was garbled
up and the check helper died with an exception. This fix eliminates any
unauthorized output to stdout be removing the filedescriptor to a save place
and replacing stdout with <tt>/dev/null</tt>.
---
.werks/398 | 14 ++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 19 +++++++++++++------
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/.werks/398 b/.werks/398
new file mode 100644
index 0000000..592fd28
--- /dev/null
+++ b/.werks/398
@@ -0,0 +1,14 @@
+Title: Tolerate debug output in check plugins when using CMC
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387369455
+Targetversion: future
+
+When using the Check_MK Micro Core and at the same time check plugins output
+debug information to stdout, the communication with the core was garbled
+up and the check helper died with an exception. This fix eliminates any
+unauthorized output to stdout be removing the filedescriptor to a save place
+and replacing stdout with <tt>/dev/null</tt>.
diff --git a/ChangeLog b/ChangeLog
index c5feb0d..73bfcd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* 0313 FIX: Avoid duplicate reading of configuration file on --create-rrd...
* 0379 FIX: check_mk -c: Now also rewrites the location of conf.d directory
* 0354 FIX: Catch exception when check plugins do not return a state...
+ * 0398 FIX: Tolerate debug output in check plugins when using CMC...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 0db56b6..1b723b5 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -5111,6 +5111,17 @@ def do_check_keepalive():
signal.signal(signal.SIGALRM, signal.SIG_IGN) # Prevent ALRM from CheckHelper.cc
+ # Prevent against plugins that output debug information (but shouldn't).
+ # Their stdout will interfer with communication with the Micro Core.
+ # We do this with a trick:
+ # 1. move the filedescriptor 1 to a parking position
+ # 2. re-open 0 on /dev/null
+ # 3. Send our answers to the Micro Core with the parked FD.
+ cmc_result_fd = os.dup(1)
+ devnull = os.open("/tmp/dev_null", os.O_WRONLY | os.O_CREAT)
+ os.dup2(devnull, 1)
+ os.close(devnull)
+
global total_check_output
total_check_output = ""
if opt_debug:
@@ -5126,9 +5137,6 @@ def do_check_keepalive():
break
hostname = hostname.strip()
if hostname == "*":
- if opt_debug:
- sys.stdout.write("Restarting myself...\n")
- sys.stdout.flush()
os.execvp("cmk", sys.argv)
elif not hostname:
break
@@ -5160,9 +5168,8 @@ def do_check_keepalive():
status = 3
total_check_output = "UNKNOWN - Check_MK timed out after %d seconds\n" % timeout
- sys.stdout.write("%03d\n%08d\n%s" %
+ os.write(cmc_result_fd, "%03d\n%08d\n%s" %
(status, len(total_check_output), total_check_output))
- sys.stdout.flush()
total_check_output = ""
cleanup_globals()
@@ -5181,7 +5188,7 @@ def do_check_keepalive():
if opt_debug:
raise
total_check_output = "UNKNOWN - %s\n" % e
- sys.stdout.write("%03d\n%08d\n%s" %
+ os.write(cmc_result_fd, "%03d\n%08d\n%s" %
(3, len(total_check_output), total_check_output))
Module: check_mk
Branch: master
Commit: c59707c214bf3f2c534a7231995762cc4a15ca23
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c59707c214bf3f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 12:59:05 2013 +0100
FIX mrpe: tolerate performance variable names with spaces
Some bizarre legacy check plugins use spaces in the names of their performance
variables. Nagios allows this under certain circumstances. The <tt>mrpe</tt>
check would fail with an exception, though.
The fix now tolerates spaces, but uses just the last component of the variable
name in that case. All RRD graphs will be created correctly, though with an
incomplete name. In most cases that should be OK.
---
.werks/397 | 16 ++++++++++++++++
ChangeLog | 1 +
checks/mrpe | 9 +++++++--
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/.werks/397 b/.werks/397
new file mode 100644
index 0000000..849b04c
--- /dev/null
+++ b/.werks/397
@@ -0,0 +1,16 @@
+Title: mrpe: tolerate performance variable names with spaces
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387367800
+Targetversion: future
+
+Some bizarre legacy check plugins use spaces in the names of their performance
+variables. Nagios allows this under certain circumstances. The <tt>mrpe</tt>
+check would fail with an exception, though.
+
+The fix now tolerates spaces, but uses just the last component of the variable
+name in that case. All RRD graphs will be created correctly, though with an
+incomplete name. In most cases that should be OK.
diff --git a/ChangeLog b/ChangeLog
index 894ed98..c5feb0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -63,6 +63,7 @@
* 0350 FIX: nfsmounts: correctly handle mount points with spaces...
* 0387 FIX: df*: Negative filesystem space levels get a more clear text in check output...
* 0351 FIX: local: Catch invalid state codes and map to 3 (UNKNOWN)...
+ * 0397 FIX: mrpe: tolerate performance variable names with spaces...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/mrpe b/checks/mrpe
index 986e73b..23be768 100644
--- a/checks/mrpe
+++ b/checks/mrpe
@@ -44,7 +44,6 @@ def mrpe_parse_perfdata(perfinfo):
def check_mrpe(item, params, info):
-
# This check is cluster-aware. An item might be found
# more than once. In that case we use the best of the
# multiple statuses.
@@ -91,7 +90,13 @@ def check_mrpe(item, params, info):
if best_state in [ None, 2 ] \
or (state < best_state and state != 2):
infotext = "\\n".join(output)
- perf_parsed = map(mrpe_parse_perfdata, perfdata)
+ perf_parsed = []
+ for perfvalue in perfdata:
+ try:
+ perf_parsed.append(mrpe_parse_perfdata(perfvalue))
+ except:
+ pass
+
# name of check command needed for PNP to choose the correct template
if check_name:
perf_parsed.append(check_name)
Module: check_mk
Branch: master
Commit: 13ae029a307379eca6d70408b3b1e027b3be8198
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=13ae029a307379…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 11:51:54 2013 +0100
FIX Catch exception when check plugins do not return a state
When a broken check plugin does not return a proper state then
Check_MK broke with an exception. This is now better handled.
The check now goes into <i>UNKNOWN</i> state with the message
<tt>Check plugin did not return any result</tt>.
---
.werks/354 | 13 +++++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 3 +++
3 files changed, 17 insertions(+)
diff --git a/.werks/354 b/.werks/354
new file mode 100644
index 0000000..84ee214
--- /dev/null
+++ b/.werks/354
@@ -0,0 +1,13 @@
+Title: Catch exception when check plugins do not return a state
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387363842
+Targetversion: future
+
+When a broken check plugin does not return a proper state then
+Check_MK broke with an exception. This is now better handled.
+The check now goes into <i>UNKNOWN</i> state with the message
+<tt>Check plugin did not return any result</tt>.
diff --git a/ChangeLog b/ChangeLog
index adecfc7..1a7a1cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
* 0087 FIX: Fixed possible locking issue when using datasource program with long output...
* 0313 FIX: Avoid duplicate reading of configuration file on --create-rrd...
* 0379 FIX: check_mk -c: Now also rewrites the location of conf.d directory
+ * 0354 FIX: Catch exception when check plugins do not return a state...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 11028ab..bab5a00 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1215,6 +1215,9 @@ def convert_perf_data(p):
def submit_check_result(host, servicedesc, result, sa):
+ if not result:
+ result = 3, "Check plugin did not return any result"
+
if len(result) >= 3:
state, infotext, perfdata = result[:3]
else:
Module: check_mk
Branch: master
Commit: 0a1fdda62621b5f5b317d24cb58f43d683e9ac45
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0a1fdda62621b5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 10:54:16 2013 +0100
Updated bug entries #1026
---
.bugs/1026 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.bugs/1026 b/.bugs/1026
index 4e63e8a..91ade01 100644
--- a/.bugs/1026
+++ b/.bugs/1026
@@ -3,7 +3,7 @@ Component: checks
State: open
Date: 2013-11-22 13:15:25
Targetversion: 1.2.3i6
-Class: nastiness
+Class: feature
The check is currently only using absolute levels, which is OK for the first moment, but
in fact it is not really a problem when having several hundret mails in the queue, as long