Module: check_mk
Branch: master
Commit: d8f2589cce4a0babc31550115c3d443d4e5d9cf0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8f2589cce4a0b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 29 12:08:51 2015 +0200
#2360 FIX esx_vsphere_vm.snapshot: Fix output of snapshot age in performance data and
graph
The check would output the timestamp instead of the age in seconds. That lead to bizarre
graphs. This has been fixed.
---
.werks/2360 | 11 +++++++++++
ChangeLog | 1 +
checks/esx_vsphere_vm | 6 +++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/2360 b/.werks/2360
new file mode 100644
index 0000000..cfa1b97
--- /dev/null
+++ b/.werks/2360
@@ -0,0 +1,11 @@
+Title: esx_vsphere_vm.snapshot: Fix output of snapshot age in performance data and graph
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1435572488
+
+The check would output the timestamp instead of the age in seconds. That lead to bizarre
+graphs. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 634d4ec..b0b5941 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
NOTE: Please refer to the migration notes!
* 2352 FIX: FreeBSD Agent: Removed statgrab cpu section because there is a dedicated
cpu section...
* 2359 FIX: adva_fsp_if: Use more reliable SNMP table, avoids sporadic problems...
+ * 2360 FIX: esx_vsphere_vm.snapshot: Fix output of snapshot age in performance data
and graph...
Multisite:
* 2314 FIX: Availability: fixed exception when grouping by host or service group
diff --git a/checks/esx_vsphere_vm b/checks/esx_vsphere_vm
index e9855f2..7f8e249 100644
--- a/checks/esx_vsphere_vm
+++ b/checks/esx_vsphere_vm
@@ -391,16 +391,16 @@ def check_esx_vsphere_vm_snapshots(_no_item, params, info):
yield 0, "Powered On: %s" % (powered_on_snapshot and
powered_on_snapshot[3] or "None")
perfdata = []
+ snapshot_age = time.time() - last_snapshot[1]
if params.get("age"):
warn, crit = params["age"]
- snapshot_age = time.time() - last_snapshot[1]
if snapshot_age > crit:
yield 2, "Snapshot is older than %s" %
get_age_human_readable(snapshot_age)
elif snapshot_age > warn:
yield 1, "Snapshot is older than %s" %
get_age_human_readable(snapshot_age)
- perfdata = [("age", last_snapshot[1], warn, crit)]
+ perfdata = [("age", snapshot_age, warn, crit)]
else:
- perfdata = [("age", last_snapshot[1])]
+ perfdata = [("age", snapshot_age)]
yield 0, "Last Snapshot: %s %s" % (last_snapshot[3],
time.strftime("%D
%H:%M",time.localtime(last_snapshot[1]))),\