Skip to content

Commit b44a098

Browse files
committed
Merge branch 'lazyfrosch-feature/sensor-unknown'
2 parents 1dcefe8 + 855810a commit b44a098

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

modules/host_disk_io_info.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sub host_disk_io_info
22
{
3-
my ($host) = @_;
3+
my ($host, $maintenance_mode_state) = @_;
44
my $value;
55
my $state = 0;
66
my $output;
@@ -11,7 +11,7 @@ sub host_disk_io_info
1111
# 0 -> existing subselect
1212
# 1 -> non existing subselect
1313

14-
$values = return_host_performance_values($host, 'disk', ('commandsAborted.summation:*', 'busResets.summation:*', 'read.average:*', 'totalReadLatency.average:*', 'write.average:*', 'totalWriteLatency.average:*', 'usage.average:*', 'kernelLatency.average:*', 'deviceLatency.average:*', 'queueLatency.average:*', 'totalLatency.average:*'));
14+
$values = return_host_performance_values($host, $maintenance_mode_state, 'disk', ('commandsAborted.summation:*', 'busResets.summation:*', 'read.average:*', 'totalReadLatency.average:*', 'write.average:*', 'totalWriteLatency.average:*', 'usage.average:*', 'kernelLatency.average:*', 'deviceLatency.average:*', 'queueLatency.average:*', 'totalLatency.average:*'));
1515

1616
if (!defined($subselect))
1717
{

modules/host_runtime_info.pm

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,13 @@ sub host_runtime_info
308308
};
309309
push(@{$components->{$actual_state}{Storage}}, $itemref);
310310

311-
if ($actual_state != 0)
311+
if ($actual_state == 3)
312+
{
313+
# Ignore unknown sensors
314+
# https://kb.vmware.com/s/article/57171
315+
next;
316+
}
317+
elsif ($actual_state != 0)
312318
{
313319
$state = check_state($state, $actual_state);
314320
$AlertCount++;
@@ -357,7 +363,13 @@ sub host_runtime_info
357363
};
358364
push(@{$components->{$actual_state}{Memory}}, $itemref);
359365

360-
if ($actual_state != 0)
366+
if ($actual_state == 3)
367+
{
368+
# Ignore unknown sensors
369+
# https://kb.vmware.com/s/article/57171
370+
next;
371+
}
372+
elsif ($actual_state != 0)
361373
{
362374
$state = check_state($state, $actual_state);
363375
$AlertCount++;
@@ -429,13 +441,14 @@ sub host_runtime_info
429441
};
430442
push(@{$components->{$actual_state}{$_->sensorType}}, $itemref);
431443

432-
if ($actual_state != 0)
444+
if ($actual_state == 3)
445+
{
446+
# Ignore unknown sensors
447+
# https://kb.vmware.com/s/article/57171
448+
next;
449+
}
450+
elsif ($actual_state != 0)
433451
{
434-
if (($actual_state == 3) && (!defined($ignoreunknown)))
435-
{
436-
# Trouble with the unknown status with sensors should better be a warning than unknown
437-
$actual_state = 1;
438-
}
439452
$state = check_state($state, $actual_state);
440453
$AlertCount++;
441454
}

0 commit comments

Comments
 (0)