Module: check_mk
Branch: master
Commit: 9950613ccc196701417d49afc08e92881b2ef448
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9950613ccc1967…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Apr 28 12:25:56 2016 +0200
3525 FIX Nagios Core: fixed bug, incomplete cleanup of process tree on service check
timeout
Datasource programs like the special agents for ESX and NetApp did not get killed
correctly,
when the service timeout was reached. This bug only applies to the Nagios Core.
---
.werks/3525 | 10 ++++++++++
ChangeLog | 3 ++-
modules/check_mk_base.py | 14 +++++++++++---
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/.werks/3525 b/.werks/3525
new file mode 100644
index 0000000..03205ad
--- /dev/null
+++ b/.werks/3525
@@ -0,0 +1,10 @@
+Title: Nagios Core: fixed bug, incomplete cleanup of process tree on service check
timeout
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1461838635
+Class: fix
+
+Datasource programs like the special agents for ESX and NetApp did not get killed
correctly,
+when the service timeout was reached. This bug only applies to the Nagios Core.
diff --git a/ChangeLog b/ChangeLog
index 6ea00c3..d66279f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -197,9 +197,9 @@
* 3126 FIX: fixed crash in some wmi-based checks when items disappear from the agent
output
* 3443 FIX: mk_logwatch: Fixed exception in agent plugin configuration parsing error
handling
* 3444 FIX: mssql: Reworked agent plugin to use less WMI calls
+ * 3525 FIX: Nagios Core: fixed bug, incomplete cleanup of process tree on service
check timeout...
Multisite:
- * 3127 new icon on services that are outside their check period
* 3187 notification view: new filter for log command via regex
* 3228 The BI Treestate painter now exports the aggregation tree as real json
structure
* 3288 Implemented grouping of services in table views...
@@ -211,6 +211,7 @@
NOTE: Please refer to the migration notes!
* 3397 Show IP addresses of a host when hovering over its name...
* 3436 Views/Dashobards: Can now be published to members of contact groups...
+ * 3127 new icon on services that are outside their check period
* 3059 FIX: Fixed highlighting of availability timeline time slices
* 3175 FIX: Fix timeranges of graphs that are embedded in a dashboard...
* 3076 FIX: fixed broken views in check_mk raw edition
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 167fd94..903ab58 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -786,9 +786,17 @@ def get_agent_info_program(commandline):
vverbose("Calling external program %s\n" % commandline)
try:
- p = subprocess.Popen(commandline, shell=True, stdin=open(os.devnull),
- stdout=subprocess.PIPE, stderr = subprocess.PIPE,
- preexec_fn=os.setsid, close_fds=True)
+ if monitoring_core == "cmc":
+ p = subprocess.Popen(commandline, shell=True, stdin=open(os.devnull),
+ stdout=subprocess.PIPE, stderr = subprocess.PIPE,
+ preexec_fn=os.setsid, close_fds=True)
+ else:
+ # We can not create a separate process group when running Nagios
+ # Upon reaching the service_check_timeout Nagios only kills the process
+ # group of the active check.
+ p = subprocess.Popen(commandline, shell=True, stdin=open(os.devnull),
+ stdout=subprocess.PIPE, stderr = subprocess.PIPE,
+ close_fds=True)
stdout, stderr = p.communicate()
exitstatus = p.returncode
except MKTimeout: