Module: check_mk
Branch: master
Commit: de4dedfc6c55e4f8d4ea05f3280cbc4d4e2ab7e8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=de4dedfc6c55e4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Sep 6 11:10:52 2016 +0200
3798 FIX Clusters: Fixed invalid timestamp of last cached agent data
Due to this bug the last checked information was around the year 1923.
---
.werks/3798 | 9 +++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 10 +++++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/3798 b/.werks/3798
new file mode 100644
index 0000000..30bb269
--- /dev/null
+++ b/.werks/3798
@@ -0,0 +1,9 @@
+Title: Clusters: Fixed invalid timestamp of last cached agent data
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1473152942
+Class: fix
+
+Due to this bug the last checked information was around the year 1923.
diff --git a/ChangeLog b/ChangeLog
index 4212f10..d5058fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -372,6 +372,7 @@
* 3770 FIX: win_dhcp_pools: Fixed crash in case of empty DHCP pools
* 3781 FIX: ipmi: made check more robust against incomplete datasets
* 3700 FIX: FIX lparstat_aix.cpu_util usage of checkgroup parameters...
+ * 3798 FIX: Clusters: Fixed invalid timestamp of last cached agent data...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index e0a29f3..39c295d 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1494,10 +1494,18 @@ def do_all_checks_on_host(hostname, ipaddress, only_check_types =
None, fetch_ag
# use the oldest of the timestamps, of course.
oldest_cached_at = None
largest_interval = None
+
+ def minn(a, b):
+ if a == None:
+ return b
+ elif b == None:
+ return a
+ return min(a,b)
+
for section_entries in g_agent_cache_info.values():
if infotype in section_entries:
cached_at, cache_interval = section_entries[infotype]
- oldest_cached_at = -max(oldest_cached_at, -cached_at)
+ oldest_cached_at = minn(oldest_cached_at, cached_at)
largest_interval = max(largest_interval, cache_interval)
submit_check_result(hostname, description, result, aggrname,