Module: check_mk
Branch: master
Commit: 3ae5ce795623a10e1d5155196f83f0f558d86449
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3ae5ce795623a1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Feb 13 16:36:27 2013 +0100
Piggyback: detect own hostname
---
modules/check_mk_base.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 4bb3b3e..5cf3b09 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -389,7 +389,7 @@ def get_realhost_info(hostname, ipaddress, check_type,
max_cache_age):
raise MKAgentError("Too short output from agent: '%s'" %
output)
lines = [ l.strip() for l in output.split('\n') ]
- info, piggybacked = parse_info(lines)
+ info, piggybacked = parse_info(lines, hostname)
store_piggyback_info(hostname, piggybacked)
store_cached_hostinfo(hostname, info)
@@ -607,7 +607,7 @@ def store_cached_checkinfo(hostname, checkname, table):
g_infocache[hostname] = { checkname: table }
# Split agent output in chunks, splits lines by whitespaces
-def parse_info(lines):
+def parse_info(lines, hostname):
info = {}
piggybacked = {} # unparsed info for other hosts
host = None
@@ -617,7 +617,7 @@ def parse_info(lines):
for line in lines:
if line[:4] == '<<<<' and line[-4:] ==
'>>>>':
host = line[4:-4]
- if not host:
+ if not host or host == hostname:
host = None # unpiggybacked "normal" host
elif host: # processing data for an other host
piggybacked.setdefault(host, []).append(line)