Module: check_mk
Branch: master
Commit: deb064d6fca7512417a5853c8c2ca8c08187da41
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=deb064d6fca751…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 20 10:40:26 2011 +0200
FIX: better handling of broken checks returning empty services
---
ChangeLog | 1 +
modules/check_mk.py | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5f092ce..0994c75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
1.1.11i1:
Core, Setup, etc.:
+ * FIX: better handling of broken checks returning empty services
* FIX: fix computation of weight when averaging
* FIX: fix detection of missing OIDs (led to empty lines)
* SNMP scan functions can now call oid(".1.3.6.1.4.1.9.9.13.1.3.1.3.*")
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 917db22..aaa3b31 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -989,7 +989,7 @@ def extra_summary_service_conf_of(hostname, description):
def extra_conf_of(confdict, hostname, service):
result = ""
for key, conflist in confdict.items():
- if service:
+ if service != None:
values = service_extra_conf(hostname, service, conflist)
else:
values = host_extra_conf(hostname, conflist)
@@ -1763,6 +1763,12 @@ def make_inventory(checkname, hostnamelist, check_only=False,
include_state=Fals
item, comment, paramstring = entry
description = service_description(checkname, item)
+ # make sanity check
+ if len(description) == 0:
+ sys.stderr.write("%s: Check %s returned empty service
description - ignoring it.\n" %
+ (hostname, checkname))
+ continue
+
# Find logical host this check belongs to. The service might belong to a
cluster.
hn = host_of_clustered_service(hostname, description)