Skip to content

Commit

Permalink
Version 1.2.2 - Some fixes
Browse files Browse the repository at this point in the history
HISTORY
check_vmware_esx.pl
modules/datastore_volumes_info.pm
modules/host_runtime_info.pm
  • Loading branch information
BaldMansMojo committed Oct 8, 2019
1 parent b44a098 commit 2a36c3b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 21 deletions.
7 changes: 7 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -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.
7 changes: 7 additions & 0 deletions check_vmware_esx.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 5 additions & 3 deletions modules/datastore_volumes_info.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down
45 changes: 27 additions & 18 deletions modules/host_runtime_info.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}
}
}
Expand Down Expand Up @@ -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++;
}
}
}
}
Expand Down Expand Up @@ -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++;
}
}
}
}
Expand Down

0 comments on commit 2a36c3b

Please sign in to comment.