Module: check_mk
Branch: master
Commit: c56e4091b8c0a10989ade76902f777860dc2e519
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c56e4091b8c0a1…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Aug 1 10:04:36 2017 +0200
4803 Always display agent version and OS in Check_MK service if available
Change-Id: I09cd790e5fe4da467151a6332f1e2d762f97a22b
---
.werks/4803 | 10 ++++++++++
cmk_base/checking.py | 8 ++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/4803 b/.werks/4803
new file mode 100644
index 0000000..1c41206
--- /dev/null
+++ b/.werks/4803
@@ -0,0 +1,10 @@
+Title: Always display agent version and OS in Check_MK service if available
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1501574646
+Class: feature
+
+
diff --git a/cmk_base/checking.py b/cmk_base/checking.py
index d45a60d..c8c4196 100644
--- a/cmk_base/checking.py
+++ b/cmk_base/checking.py
@@ -90,6 +90,7 @@ def do_check(hostname, ipaddress, only_check_types = None):
do_all_checks_on_host(hostname, ipaddress, only_check_types)
agent_version = cmk_info["version"]
+ agent_os = cmk_info.get("agentos")
num_errors = len(error_sections)
@@ -137,10 +138,13 @@ def do_check(hostname, ipaddress, only_check_types = None):
else:
output = ""
- if not config.is_cluster(hostname) and agent_version != None:
- output += "Agent version %s, " % agent_version
status = 0
+ if not config.is_cluster(hostname) and agent_version != None:
+ output += "Agent version %s, " % agent_version
+ if not config.is_cluster(hostname) and agent_os != None:
+ output += "Agent OS %s, " % agent_os
+
except MKTimeout:
raise