Module: check_mk
Branch: master
Commit: 1ac4550017903893f592e1ec548c8111fda3cf2a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ac45500179038…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jan 16 09:56:44 2017 +0100
added some comments and handling of cluster hosts in check API function
get_agent_data_time()
Change-Id: Ia58eeaac4d6336120bed1675499712f740e52de2
---
modules/check_mk_base.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 80414d4..b68e266 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -2054,11 +2054,18 @@ def passwordstore_get_cmdline(fmt, pw):
# '----------------------------------------------------------------------'
+# Use this function to get the age of the agent data cache file
+# of tcp or snmp hosts or None in case of piggyback data because
+# we do not exactly know the latest agent data. Maybe one time
+# we can handle this. For cluster hosts an exception is raised.
def get_agent_data_time():
return agent_cache_file_age(g_hostname, g_check_type)
def agent_cache_file_age(hostname, check_type):
+ if is_cluster(hostname):
+ raise MKGeneralException("get_agent_data_time() not valid for
cluster")
+
if is_snmp_check(check_type):
cachefile = cmk.paths.tcp_cache_dir + "/" + hostname + "." +
check_type.split(".")[0]
elif is_tcp_check(check_type):