Module: check_mk
Branch: master
Commit: 037250280794ff85ba05ea3233c3389eccc11632
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=037250280794ff…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Thu Jul 5 13:31:39 2018 +0200
Use default mechanism
The default value to get_item_state should be a valid
item state tuple, or simply None.
Change-Id: Icf0f6c8054870117a1f74f429010c8e263ac93e0
---
checks/esx_vsphere_counters | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/checks/esx_vsphere_counters b/checks/esx_vsphere_counters
index c5743b6..c854a92 100644
--- a/checks/esx_vsphere_counters
+++ b/checks/esx_vsphere_counters
@@ -319,8 +319,9 @@ def convert_esx_counters_if(parsed):
if ctr_name.startswith("bytes"):
ctr_value *= 1024
countername = "vmnic." + name + "." + ctr_name
- last_time, last_value = get_item_state(countername, (None, None))
- if last_time or last_value:
+ last_state = get_item_state(countername)
+ if last_state:
+ last_time, last_value = last_state
new_value = last_value + ((this_time - last_time) * ctr_value)
else:
last_time = this_time - 60