Module: check_mk
Branch: master
Commit: 5e0d72b0d9edf5fa158075ee48b5a517c40a0a8a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5e0d72b0d9edf5…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed Dec 11 09:45:01 2013 +0100
FIX Fixed possible locking issue when using datasource program with long output
Version 1.2.3i7 introducted a problem where datasource programs producing a long
output could lock up the check execution. This resulted in failed checks and
non inventorized services on the affected host.
---
.werks/87 | 12 ++++++++++++
ChangeLog | 3 +++
modules/check_mk_base.py | 10 +++++++---
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/.werks/87 b/.werks/87
new file mode 100644
index 0000000..e1f33e0
--- /dev/null
+++ b/.werks/87
@@ -0,0 +1,12 @@
+Title: Fixed possible locking issue when using datasource program with long output
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.3i8
+Date: 1386751376
+Targetversion: future
+
+Version 1.2.3i7 introducted a problem where datasource programs producing a long
+output could lock up the check execution. This resulted in failed checks and
+non inventorized services on the affected host.
diff --git a/ChangeLog b/ChangeLog
index afd7c77..3230c44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.2.3i8:
+ Core & Setup:
+ * 0087 FIX: Fixed possible locking issue when using datasource program with long
output...
+
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
* 0073 moxa_iologik_register: new check to monitor moxa e2000 series registers
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 657749f..b70543e 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -618,9 +618,13 @@ def get_agent_info_program(commandline):
sys.stderr.write("Calling external program %s\n" % commandline)
try:
p = subprocess.Popen(commandline, shell = True, stdout = subprocess.PIPE, stderr
= subprocess.PIPE)
- exitstatus = p.wait()
- stdout = p.stdout.read()
- stderr = p.stderr.read()
+ stdout = ""
+ stderr = ""
+ while p.poll() is None:
+ response = p.communicate()
+ stdout += response[0]
+ stderr += response[1]
+ exitstatus = p.returncode
except Exception, e:
raise MKAgentError("Could not execute '%s': %s" % (commandline,
e))