Module: check_mk
Branch: master
Commit: 0ffa60766d416c819afc9ab430637afb491fe98b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0ffa60766d416c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 30 12:16:04 2010 +0100
Fixed additional output which should not be generated when using --automation
---
modules/check_mk.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 110e3c5..9ea8896 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1700,15 +1700,19 @@ def make_inventory(checkname, hostnamelist, check_only=False,
include_state=Fals
try:
info = get_realhost_info(hostname, ipaddress, checkname_base,
inventory_max_cachefile_age)
except MKAgentError, e:
- if check_only and str(e):
+ # This special handling is needed for the inventory check. It needs
special
+ # handling for WATO.
+ if check_only and not include_state and str(e):
raise
- elif str(e):
+ elif not include_state and str(e):
sys.stderr.write("Host '%s': %s\n" % (hostname, str(e)))
continue
except MKSNMPError, e:
- if check_only and str(e):
+ # This special handling is needed for the inventory check. It needs
special
+ # handling for WATO.
+ if check_only and not include_state and str(e):
raise
- elif str(e):
+ elif not include_state and str(e):
sys.stderr.write("Host '%s': %s\n" % (hostname,
str(e)))
continue
except Exception, e: