Skip to content

Commit 2a36c3b

Browse files
committed
Version 1.2.2 - Some fixes
HISTORY check_vmware_esx.pl modules/datastore_volumes_info.pm modules/host_runtime_info.pm
1 parent b44a098 commit 2a36c3b

File tree

4 files changed

+46
-21
lines changed

4 files changed

+46
-21
lines changed

HISTORY

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,3 +1302,10 @@ was done
13021302
- Added fix from Claudio Kuenzler
13031303
- Corrected perf data on net checks
13041304
- Replaced elsif by else...if in datastore_volumes_info().
1305+
1306+
- 9 Oct 2019 M.Fuerstenau version 1.2.2
1307+
- Added some fixes in host_runtime_info.pm and host_disk_io_info.pm
1308+
from Markus Frosch (lazyfrosch) - Netways. Fixes unknown states in
1309+
host_runtime_info() and maintenance_mode_state in host_disk_io_info().
1310+
But elsif was replaced by else if because in my opninio elsif shredders the
1311+
structure of the code.

check_vmware_esx.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,13 @@
13811381
# - Added fix from Claudio Kuenzler
13821382
# - Corrected perf data on net checks
13831383
# - Replace elsif by else ...if in datastore_volumes_info()
1384+
#
1385+
# - 9 Oct 2019 M.Fuerstenau version 1.2.2
1386+
# - Added some fixes in host_runtime_info.pm and host_disk_io_info.pm
1387+
# from Markus Frosch (lazyfrosch) - Netways. Fixes unknown states in
1388+
# host_runtime_info() and maintenance_mode_state in host_disk_io_info().
1389+
# But elsif was replaced by else if because in my opninio elsif shredders the
1390+
# structure of the code.
13841391

13851392
use strict;
13861393
use warnings;

modules/datastore_volumes_info.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ sub datastore_volumes_info
2828
my $volume_type;
2929
my $uom = "MB";
3030
my $alertcnt = 0;
31-
31+
my $stores;
32+
my $store;
33+
3234
if (defined($subselect) && defined($blacklist) && !defined($isregexp))
3335
{
3436
print "Error! Blacklist is supported only in overall check (no subselect) or regexp subcheck!\n";
@@ -56,8 +58,8 @@ sub datastore_volumes_info
5658
$isregexp = 0;
5759
}
5860

59-
my $stores = Vim::get_views(mo_ref_array => $datastore, properties => ['summary', 'info']);
60-
foreach my $store (@{$stores})
61+
$stores = Vim::get_views(mo_ref_array => $datastore, properties => ['summary', 'info']);
62+
foreach $store (@{$stores})
6163
{
6264
$name = $store->summary->name;
6365
$volume_type = $store->summary->type;

modules/host_runtime_info.pm

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,17 @@ sub host_runtime_info
314314
# https://kb.vmware.com/s/article/57171
315315
next;
316316
}
317-
elsif ($actual_state != 0)
318-
{
319-
$state = check_state($state, $actual_state);
320-
$AlertCount++;
321-
}
322317
else
323318
{
324-
$OKCount++;
319+
if ($actual_state != 0)
320+
{
321+
$state = check_state($state, $actual_state);
322+
$AlertCount++;
323+
}
324+
else
325+
{
326+
$OKCount++;
327+
}
325328
}
326329
}
327330
}
@@ -369,14 +372,17 @@ sub host_runtime_info
369372
# https://kb.vmware.com/s/article/57171
370373
next;
371374
}
372-
elsif ($actual_state != 0)
373-
{
374-
$state = check_state($state, $actual_state);
375-
$AlertCount++;
376-
}
377375
else
378376
{
379-
$OKCount++;
377+
if ($actual_state != 0)
378+
{
379+
$state = check_state($state, $actual_state);
380+
$AlertCount++;
381+
}
382+
else
383+
{
384+
$OKCount++;
385+
}
380386
}
381387
}
382388
}
@@ -447,14 +453,17 @@ sub host_runtime_info
447453
# https://kb.vmware.com/s/article/57171
448454
next;
449455
}
450-
elsif ($actual_state != 0)
451-
{
452-
$state = check_state($state, $actual_state);
453-
$AlertCount++;
454-
}
455456
else
456457
{
457-
$OKCount++;
458+
if ($actual_state != 0)
459+
{
460+
$state = check_state($state, $actual_state);
461+
$AlertCount++;
462+
}
463+
else
464+
{
465+
$OKCount++;
466+
}
458467
}
459468
}
460469
}

0 commit comments

Comments
 (0)