Module: check_mk
Branch: master
Commit: 1995244cc9824bca5642a50899633ce0963e217d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1995244cc9824b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Aug 19 21:45:15 2011 +0200
Show datasource program on cmk -D
---
.bugs/210 | 10 +++++++---
ChangeLog | 1 +
modules/check_mk.py | 8 +++++++-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.bugs/210 b/.bugs/210
index 6a31f23..f412880 100644
--- a/.bugs/210
+++ b/.bugs/210
@@ -1,10 +1,14 @@
Title: check_mk -D HOST does not display datasource_programs
Component: core
+State: done
+Class: cleanup
+Date: 2011-03-15 15:20:50
Benefit: 1
-State: open
Cost: 1
-Date: 2011-03-15 15:20:50
-Class: cleanup
+Fun: 0
It should rather display the command line of that host
than (TCP port 6556).
+
+2011-08-19 21:44:58: changed state open -> done
+Datasource program including IP adress is shown.
diff --git a/ChangeLog b/ChangeLog
index b97602a..545d4d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
Please use OMD instead.
* Inventory functions now only take the single argument 'info'. The old
style FUNC(checkname, info) is still supported but deprecated.
+ * Show datasource program on cmk -D
Checks & Agents:
* FIX: printer_pages: workaround for trailing-zero bug in HP Jetdirect
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 9da7873..0991fba 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3114,9 +3114,11 @@ def dump_host(hostname):
else:
color = tty_bgblue
try:
- add_txt = " (%s)" % lookup_ipaddress(hostname)
+ ipaddress = lookup_ipaddress(hostname)
+ add_txt = " (%s)" % ipaddress
except:
add_txt = " (no DNS, no entry in ipaddresses)"
+ ipaddress = "X.X.X.X"
print "%s%s%s%-78s %s" % (color, tty_bold, tty_white, hostname + add_txt,
tty_normal)
tags = tags_of_host(hostname)
@@ -3130,6 +3132,10 @@ def dump_host(hostname):
print tty_yellow + "Host groups: " + tty_normal + ",
".join(hostgroups_of(hostname))
print tty_yellow + "Contact groups: " + tty_normal + ",
".join(host_contactgroups_of([hostname]))
agenttype = "TCP (port: %d)" % agent_port_of(hostname)
+ dapg = get_datasource_program(hostname, ipaddress)
+ if dapg:
+ agenttype = "Datasource program: %s" % dapg
+
if is_snmp_host(hostname):
if is_usewalk_host(hostname):
agenttype = "SNMP (use stored walk)"