From ee515de275e0ae227c22debe41cbbf7d4c5732dc Mon Sep 17 00:00:00 2001 From: Simon Josi Date: Wed, 28 Jan 2015 20:12:30 +0100 Subject: [PATCH 1/2] esxi_monitor.pl: check for datastructure to be non-empty before access, otherwise get_info() fails silently on empty values --- ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl b/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl index 6a48c1f..e09702c 100644 --- a/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl +++ b/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl @@ -183,7 +183,7 @@ sub get_info { my $values; $values = get_performance_values($views, $perfmgr_view, $group_type, ($counter.".".$rollup_type)); - if (defined($values)) { + if (defined($values) && scalar @$values) { my ( $t ) = split(/,/, $$values[0][0]->value); return $t; } diff --git a/setup.py b/setup.py index ef413bb..fa0552a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # or saved. Do not modify them directly here. # NB: PACKAGES is deprecated NAME = "ZenPacks.community.VMwareESXiMonitor" -VERSION = "2.0.1" +VERSION = "2.0.2" AUTHOR = "Eric Enns, Matthias Kittl" LICENSE = "" NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.community'] From 7262f67e10a7cb83a37f5bdbc9d9c40892da44ce Mon Sep 17 00:00:00 2001 From: Simon Josi Date: Thu, 29 Jan 2015 15:52:54 +0100 Subject: [PATCH 2/2] esxi_monitor.pl: use more thorough check if data is acutally available --- ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl b/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl index e09702c..54989a2 100644 --- a/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl +++ b/ZenPacks/community/VMwareESXiMonitor/libexec/esxi_monitor.pl @@ -183,7 +183,7 @@ sub get_info { my $values; $values = get_performance_values($views, $perfmgr_view, $group_type, ($counter.".".$rollup_type)); - if (defined($values) && scalar @$values) { + if (defined($values) && exists $$values[0][0]->{value}) { my ( $t ) = split(/,/, $$values[0][0]->value); return $t; } diff --git a/setup.py b/setup.py index fa0552a..34c6d28 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # or saved. Do not modify them directly here. # NB: PACKAGES is deprecated NAME = "ZenPacks.community.VMwareESXiMonitor" -VERSION = "2.0.2" +VERSION = "2.0.3" AUTHOR = "Eric Enns, Matthias Kittl" LICENSE = "" NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.community']