Module: check_mk
Branch: master
Commit: fd2c751e4734de53885f9a0ea7b4c9d948b12e6c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd2c751e4734de…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 4 10:30:33 2011 +0100
Fix check_mk -D if host has no ip address
---
ChangeLog | 1 +
modules/check_mk.py | 5 ++++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 37e344c..835b657 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.1.10b2:
Core, Setup, etc.:
* FIX: setup.sh on OMD: fix paths for cache and counters
+ * FIX: check_mk -D did bail out if host had no ip address
WATO:
* FIX: Fixed bug that lost autochecks when using WATO and cmk -II together
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 0ec6f58..31aef25 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2842,7 +2842,10 @@ def dump_host(hostname):
add_txt = " (cluster of " + (",".join(nodes_of(hostname))) +
")"
else:
color = tty_bgblue
- add_txt = " (%s)" % lookup_ipaddress(hostname)
+ try:
+ add_txt = " (%s)" % lookup_ipaddress(hostname)
+ except:
+ add_txt = " (no DNS, no entry in ipaddresses)"
print "%s%s%s%-78s %s" % (color, tty_bold, tty_white, hostname + add_txt,
tty_normal)
tags = tags_of_host(hostname)