diff --git a/HISTORY b/HISTORY index 2344042..03cf06c 100644 --- a/HISTORY +++ b/HISTORY @@ -1302,3 +1302,10 @@ was done - Added fix from Claudio Kuenzler - Corrected perf data on net checks - Replaced elsif by else...if in datastore_volumes_info(). + +- 9 Oct 2019 M.Fuerstenau version 1.2.2 + - Added some fixes in host_runtime_info.pm and host_disk_io_info.pm + from Markus Frosch (lazyfrosch) - Netways. Fixes unknown states in + host_runtime_info() and maintenance_mode_state in host_disk_io_info(). + But elsif was replaced by else if because in my opninio elsif shredders the + structure of the code. diff --git a/check_vmware_esx.pl b/check_vmware_esx.pl index 234eba2..8d8d8ad 100755 --- a/check_vmware_esx.pl +++ b/check_vmware_esx.pl @@ -1381,6 +1381,13 @@ # - Added fix from Claudio Kuenzler # - Corrected perf data on net checks # - Replace elsif by else ...if in datastore_volumes_info() +# +# - 9 Oct 2019 M.Fuerstenau version 1.2.2 +# - Added some fixes in host_runtime_info.pm and host_disk_io_info.pm +# from Markus Frosch (lazyfrosch) - Netways. Fixes unknown states in +# host_runtime_info() and maintenance_mode_state in host_disk_io_info(). +# But elsif was replaced by else if because in my opninio elsif shredders the +# structure of the code. use strict; use warnings; diff --git a/modules/datastore_volumes_info.pm b/modules/datastore_volumes_info.pm index 25b0f44..a118570 100644 --- a/modules/datastore_volumes_info.pm +++ b/modules/datastore_volumes_info.pm @@ -28,7 +28,9 @@ sub datastore_volumes_info my $volume_type; my $uom = "MB"; my $alertcnt = 0; - + my $stores; + my $store; + if (defined($subselect) && defined($blacklist) && !defined($isregexp)) { print "Error! Blacklist is supported only in overall check (no subselect) or regexp subcheck!\n"; @@ -56,8 +58,8 @@ sub datastore_volumes_info $isregexp = 0; } - my $stores = Vim::get_views(mo_ref_array => $datastore, properties => ['summary', 'info']); - foreach my $store (@{$stores}) + $stores = Vim::get_views(mo_ref_array => $datastore, properties => ['summary', 'info']); + foreach $store (@{$stores}) { $name = $store->summary->name; $volume_type = $store->summary->type; diff --git a/modules/host_runtime_info.pm b/modules/host_runtime_info.pm index 0056c79..1a7e73a 100644 --- a/modules/host_runtime_info.pm +++ b/modules/host_runtime_info.pm @@ -314,14 +314,17 @@ sub host_runtime_info # https://kb.vmware.com/s/article/57171 next; } - elsif ($actual_state != 0) - { - $state = check_state($state, $actual_state); - $AlertCount++; - } else { - $OKCount++; + if ($actual_state != 0) + { + $state = check_state($state, $actual_state); + $AlertCount++; + } + else + { + $OKCount++; + } } } } @@ -369,14 +372,17 @@ sub host_runtime_info # https://kb.vmware.com/s/article/57171 next; } - elsif ($actual_state != 0) - { - $state = check_state($state, $actual_state); - $AlertCount++; - } else { - $OKCount++; + if ($actual_state != 0) + { + $state = check_state($state, $actual_state); + $AlertCount++; + } + else + { + $OKCount++; + } } } } @@ -447,14 +453,17 @@ sub host_runtime_info # https://kb.vmware.com/s/article/57171 next; } - elsif ($actual_state != 0) - { - $state = check_state($state, $actual_state); - $AlertCount++; - } else { - $OKCount++; + if ($actual_state != 0) + { + $state = check_state($state, $actual_state); + $AlertCount++; + } + else + { + $OKCount++; + } } } }