enh(dell/cmc/snmp): add disk and vdisk components (#3010)
This commit is contained in:
parent
0715c44d5c
commit
4fafc965e1
|
@ -26,19 +26,19 @@ use warnings;
|
||||||
# In MIB 'DELL-RAC-MIB'
|
# In MIB 'DELL-RAC-MIB'
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
drsWattsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.1.1.13', section => 'power', label => 'power', unit => 'watt' },
|
drsWattsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.1.1.13', section => 'power', label => 'power', unit => 'watt' },
|
||||||
drsAmpsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.1.1.14', section => 'current', label => 'current', unit => 'ampere' },
|
drsAmpsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.1.1.14', section => 'current', label => 'current', unit => 'ampere' }
|
||||||
};
|
};
|
||||||
my $oid_drsCMCPowerTableEntrydrsCMCPowerTableEntry = '.1.3.6.1.4.1.674.10892.2.4.1.1';
|
my $oid_drsCMCPowerTableEntrydrsCMCPowerTableEntry = '.1.3.6.1.4.1.674.10892.2.4.1.1';
|
||||||
|
|
||||||
sub load {
|
sub load {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
push @{$self->{request}}, { oid => $oid_drsCMCPowerTableEntrydrsCMCPowerTableEntry };
|
push @{$self->{request}}, { oid => $oid_drsCMCPowerTableEntrydrsCMCPowerTableEntry };
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check {
|
sub check {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => "Checking chassis");
|
$self->{output}->output_add(long_msg => "Checking chassis");
|
||||||
$self->{components}->{chassis} = { name => 'chassis', total => 0, skip => 0 };
|
$self->{components}->{chassis} = { name => 'chassis', total => 0, skip => 0 };
|
||||||
return if ($self->check_filter(section => 'chassis'));
|
return if ($self->check_filter(section => 'chassis'));
|
||||||
|
@ -51,17 +51,29 @@ sub check {
|
||||||
next if ($self->check_filter(section => 'chassis', instance => $instance));
|
next if ($self->check_filter(section => 'chassis', instance => $instance));
|
||||||
$self->{components}->{chassis}->{total}++;
|
$self->{components}->{chassis}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("Chassis '%s': power %s W, current %s A [instance: %s].",
|
$self->{output}->output_add(
|
||||||
$instance, $result->{drsWattsReading}, $result->{drsAmpsReading},
|
long_msg => sprintf(
|
||||||
$instance
|
"chassis '%s': power %s W, current %s A [instance: %s].",
|
||||||
));
|
$instance,
|
||||||
|
$result->{drsWattsReading},
|
||||||
|
$result->{drsAmpsReading},
|
||||||
|
$instance
|
||||||
|
)
|
||||||
|
);
|
||||||
foreach my $probe (('drsWattsReading', 'drsAmpsReading')) {
|
foreach my $probe (('drsWattsReading', 'drsAmpsReading')) {
|
||||||
next if (!defined($result->{$probe}));
|
next if (!defined($result->{$probe}));
|
||||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'chassis.' . $mapping->{$probe}->{section}, instance => $instance, value => $result->{$probe});
|
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'chassis.' . $mapping->{$probe}->{section}, instance => $instance, value => $result->{$probe});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(
|
||||||
short_msg => sprintf("Chassis '%s' %s is %s%s", $instance,
|
severity => $exit,
|
||||||
$mapping->{$probe}->{section}, $result->{$probe}, $mapping->{$probe}->{unit}));
|
short_msg => sprintf(
|
||||||
|
"Chassis '%s' %s is %s%s",
|
||||||
|
$instance,
|
||||||
|
$mapping->{$probe}->{section},
|
||||||
|
$result->{$probe},
|
||||||
|
$mapping->{$probe}->{unit}
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'chassis_' . $mapping->{$probe}->{label}, unit => $mapping->{$probe}->{unit},
|
label => 'chassis_' . $mapping->{$probe}->{label}, unit => $mapping->{$probe}->{unit},
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
#
|
||||||
|
# Copyright 2021 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package hardware::server::dell::cmc::snmp::mode::components::disk;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use hardware::server::dell::cmc::snmp::mode::components::resources qw($map_status);
|
||||||
|
|
||||||
|
my $mapping = {
|
||||||
|
name => { oid => '.1.3.6.1.4.1.674.10892.2.6.1.20.130.4.1.2' }, # physicalDiskName
|
||||||
|
status => { oid => '.1.3.6.1.4.1.674.10892.2.6.1.20.130.4.1.24', map => $map_status } # physicalDiskComponentStatus
|
||||||
|
};
|
||||||
|
|
||||||
|
sub load {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
push @{$self->{request}}, { oid => $mapping->{name}->{oid} }, { oid => $mapping->{status}->{oid} };
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
$self->{output}->output_add(long_msg => "Checking disks");
|
||||||
|
$self->{components}->{disk} = { name => 'disks', total => 0, skip => 0 };
|
||||||
|
return if ($self->check_filter(section => 'disk'));
|
||||||
|
|
||||||
|
my $snmp_result = {
|
||||||
|
%{$self->{results}->{ $mapping->{name}->{oid} }},
|
||||||
|
%{$self->{results}->{ $mapping->{status}->{oid} }}
|
||||||
|
};
|
||||||
|
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %$snmp_result)) {
|
||||||
|
next if ($oid !~ /^$mapping->{name}->{oid}\.(.*)$/);
|
||||||
|
my $instance = $1;
|
||||||
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
|
||||||
|
|
||||||
|
next if ($self->check_filter(section => 'disk', instance => $instance));
|
||||||
|
$self->{components}->{disk}->{total}++;
|
||||||
|
|
||||||
|
$self->{output}->output_add(
|
||||||
|
long_msg => sprintf(
|
||||||
|
"disk '%s' status is '%s' [instance: %s]",
|
||||||
|
$result->{name},
|
||||||
|
$result->{status},
|
||||||
|
$instance
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
my $exit = $self->get_severity(label => 'default', section => 'disk', value => $result->{status});
|
||||||
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
|
$self->{output}->output_add(
|
||||||
|
severity => $exit,
|
||||||
|
short_msg => sprintf("disk '%s' status is '%s'", $result->{name}, $result->{status})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
|
@ -22,32 +22,24 @@ package hardware::server::dell::cmc::snmp::mode::components::health;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use hardware::server::dell::cmc::snmp::mode::components::resources qw($map_status);
|
||||||
my %map_health_status = (
|
|
||||||
1 => 'other',
|
|
||||||
2 => 'unknown',
|
|
||||||
3 => 'ok',
|
|
||||||
4 => 'nonCritical',
|
|
||||||
5 => 'critical',
|
|
||||||
6 => 'nonRecoverable',
|
|
||||||
);
|
|
||||||
|
|
||||||
# In MIB 'DELL-RAC-MIB'
|
# In MIB 'DELL-RAC-MIB'
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
drsIOMCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.2', map => \%map_health_status, descr => 'IOM status' },
|
drsIOMCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.2', map => $map_status, descr => 'IOM status' },
|
||||||
drsKVMCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.3', map => \%map_health_status, descr => 'iKVM status' },
|
drsKVMCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.3', map => $map_status, descr => 'iKVM status' },
|
||||||
drsRedCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.4', map => \%map_health_status, descr => 'Redundancy status' },
|
drsRedCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.4', map => $map_status, descr => 'Redundancy status' },
|
||||||
drsPowerCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.5', map => \%map_health_status, descr => 'Power status' },
|
drsPowerCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.5', map => $map_status, descr => 'Power status' },
|
||||||
drsFanCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.6', map => \%map_health_status, descr => 'Fan status' },
|
drsFanCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.6', map => $map_status, descr => 'Fan status' },
|
||||||
drsBladeCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.7', map => \%map_health_status, descr => 'Blade status' },
|
drsBladeCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.7', map => $map_status, descr => 'Blade status' },
|
||||||
drsTempCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.8', map => \%map_health_status, descr => 'Temperature status' },
|
drsTempCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.8', map => $map_status, descr => 'Temperature status' },
|
||||||
drsCMCCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.9', map => \%map_health_status, descr => 'CMC status' },
|
drsCMCCurrStatus => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.9', map => $map_status, descr => 'CMC status' }
|
||||||
};
|
};
|
||||||
my $oid_drsStatusNowGroup = '.1.3.6.1.4.1.674.10892.2.3.1';
|
my $oid_drsStatusNowGroup = '.1.3.6.1.4.1.674.10892.2.3.1';
|
||||||
|
|
||||||
sub load {
|
sub load {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
|
|
||||||
push @{$self->{request}}, { oid => $oid_drsStatusNowGroup, start => $mapping->{drsIOMCurrStatus}->{oid}, end => $mapping->{drsCMCCurrStatus}->{oid} };
|
push @{$self->{request}}, { oid => $oid_drsStatusNowGroup, start => $mapping->{drsIOMCurrStatus}->{oid}, end => $mapping->{drsCMCCurrStatus}->{oid} };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +50,7 @@ sub check {
|
||||||
$self->{components}->{health} = {name => 'health', total => 0, skip => 0};
|
$self->{components}->{health} = {name => 'health', total => 0, skip => 0};
|
||||||
return if ($self->check_filter(section => 'health'));
|
return if ($self->check_filter(section => 'health'));
|
||||||
|
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_drsStatusNowGroup}, instance => '0');
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_drsStatusNowGroup}, instance => 0);
|
||||||
foreach my $probe (keys %{$mapping}) {
|
foreach my $probe (keys %{$mapping}) {
|
||||||
next if (!defined($result->{$probe}));
|
next if (!defined($result->{$probe}));
|
||||||
$mapping->{$probe}->{oid} =~ /\.(\d+)$/;
|
$mapping->{$probe}->{oid} =~ /\.(\d+)$/;
|
||||||
|
@ -67,15 +59,24 @@ sub check {
|
||||||
next if ($self->check_filter(section => 'health', instance => $instance));
|
next if ($self->check_filter(section => 'health', instance => $instance));
|
||||||
$self->{components}->{health}->{total}++;
|
$self->{components}->{health}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("%s is %s [instance: %s].",
|
$self->{output}->output_add(
|
||||||
$mapping->{$probe}->{descr}, $result->{$probe},
|
long_msg => sprintf(
|
||||||
$instance
|
"%s is %s [instance: %s].",
|
||||||
));
|
$mapping->{$probe}->{descr},
|
||||||
my $exit = $self->get_severity(section => 'health', value => $result->{$probe});
|
$result->{$probe},
|
||||||
|
$instance
|
||||||
|
)
|
||||||
|
);
|
||||||
|
my $exit = $self->get_severity(label => 'default', section => 'health', value => $result->{$probe});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(
|
||||||
short_msg => sprintf("%s is %s",
|
severity => $exit,
|
||||||
$mapping->{$probe}->{descr}, $result->{$probe}));
|
short_msg => sprintf(
|
||||||
|
"%s is %s",
|
||||||
|
$mapping->{$probe}->{descr},
|
||||||
|
$result->{$probe}
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ use warnings;
|
||||||
my %map_psu_capable = (
|
my %map_psu_capable = (
|
||||||
1 => 'absent',
|
1 => 'absent',
|
||||||
2 => 'none',
|
2 => 'none',
|
||||||
3 => 'basic',
|
3 => 'basic'
|
||||||
);
|
);
|
||||||
|
|
||||||
# In MIB 'DELL-RAC-MIB'
|
# In MIB 'DELL-RAC-MIB'
|
||||||
|
@ -35,7 +35,7 @@ my $mapping = {
|
||||||
drsPSUMonitoringCapable => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.4', map => \%map_psu_capable },
|
drsPSUMonitoringCapable => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.4', map => \%map_psu_capable },
|
||||||
drsPSUVoltsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.5', section => 'voltage', label => 'voltage', unit => 'volt' },
|
drsPSUVoltsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.5', section => 'voltage', label => 'voltage', unit => 'volt' },
|
||||||
drsPSUAmpsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.6', section => 'current', label => 'current', unit => 'ampere' },
|
drsPSUAmpsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.6', section => 'current', label => 'current', unit => 'ampere' },
|
||||||
drsPSUWattsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.7', section => 'power', label => 'power', unit => 'watt' },
|
drsPSUWattsReading => { oid => '.1.3.6.1.4.1.674.10892.2.4.2.1.7', section => 'power', label => 'power', unit => 'watt' }
|
||||||
};
|
};
|
||||||
my $oid_drsCMCPSUTableEntry = '.1.3.6.1.4.1.674.10892.2.4.2.1';
|
my $oid_drsCMCPSUTableEntry = '.1.3.6.1.4.1.674.10892.2.4.2.1';
|
||||||
|
|
||||||
|
@ -61,17 +61,29 @@ sub check {
|
||||||
next if ($result->{drsPSUMonitoringCapable} !~ /basic/i);
|
next if ($result->{drsPSUMonitoringCapable} !~ /basic/i);
|
||||||
$self->{components}->{psu}->{total}++;
|
$self->{components}->{psu}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("Power supply '%s': power %s W, current %s A, voltage %s V [instance: %s].",
|
$self->{output}->output_add(
|
||||||
$result->{drsPSULocation}, $result->{drsPSUWattsReading}, $result->{drsPSUAmpsReading}, $result->{drsPSUVoltsReading},
|
long_msg => sprintf(
|
||||||
$instance
|
"power supply '%s': power %s W, current %s A, voltage %s V [instance: %s].",
|
||||||
));
|
$result->{drsPSULocation},
|
||||||
|
$result->{drsPSUWattsReading},
|
||||||
|
$result->{drsPSUAmpsReading},
|
||||||
|
$result->{drsPSUVoltsReading},
|
||||||
|
$instance
|
||||||
|
)
|
||||||
|
);
|
||||||
foreach my $probe (('drsPSUVoltsReading', 'drsPSUAmpsReading', 'drsPSUWattsReading')) {
|
foreach my $probe (('drsPSUVoltsReading', 'drsPSUAmpsReading', 'drsPSUWattsReading')) {
|
||||||
next if (!defined($result->{$probe}));
|
next if (!defined($result->{$probe}));
|
||||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'psu.' . $mapping->{$probe}->{section}, instance => $instance, value => $result->{$probe});
|
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'psu.' . $mapping->{$probe}->{section}, instance => $instance, value => $result->{$probe});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(
|
||||||
short_msg => sprintf("Power supply '%s' %s is %s%s", $result->{drsPSULocation},
|
severity => $exit,
|
||||||
$mapping->{$probe}->{section}, $result->{$probe}, $mapping->{$probe}->{unit}));
|
short_msg => sprintf(
|
||||||
|
"Power supply '%s' %s is %s%s",
|
||||||
|
$result->{drsPSULocation},
|
||||||
|
$mapping->{$probe}->{section},
|
||||||
|
$result->{$probe}, $mapping->{$probe}->{unit}
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'psu_' . $mapping->{$probe}->{label}, unit => $mapping->{$probe}->{unit},
|
label => 'psu_' . $mapping->{$probe}->{label}, unit => $mapping->{$probe}->{unit},
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
#
|
||||||
|
# Copyright 2021 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package hardware::server::dell::cmc::snmp::mode::components::resources;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Exporter;
|
||||||
|
|
||||||
|
our $map_status;
|
||||||
|
|
||||||
|
our @ISA = qw(Exporter);
|
||||||
|
our @EXPORT_OK = qw($map_status);
|
||||||
|
|
||||||
|
$map_status = {
|
||||||
|
1 => 'other',
|
||||||
|
2 => 'unknown',
|
||||||
|
3 => 'ok',
|
||||||
|
4 => 'nonCritical',
|
||||||
|
5 => 'critical',
|
||||||
|
6 => 'nonRecoverable'
|
||||||
|
};
|
||||||
|
|
||||||
|
1;
|
|
@ -27,7 +27,7 @@ use warnings;
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
drsChassisFrontPanelAmbientTemperature => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.10', instance => 'chassis', descr => 'Chassis Ambient temperature' },
|
drsChassisFrontPanelAmbientTemperature => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.10', instance => 'chassis', descr => 'Chassis Ambient temperature' },
|
||||||
drsCMCAmbientTemperature => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.11', instance => 'ambient', descr => 'CMC Ambient temperarture' },
|
drsCMCAmbientTemperature => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.11', instance => 'ambient', descr => 'CMC Ambient temperarture' },
|
||||||
drsCMCProcessorTemperature => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.12', instance => 'processor', descr => 'Processor temperature' },
|
drsCMCProcessorTemperature => { oid => '.1.3.6.1.4.1.674.10892.2.3.1.12', instance => 'processor', descr => 'Processor temperature' }
|
||||||
};
|
};
|
||||||
my $oid_drsChassisStatusGroup = '.1.3.6.1.4.1.674.10892.2.3';
|
my $oid_drsChassisStatusGroup = '.1.3.6.1.4.1.674.10892.2.3';
|
||||||
|
|
||||||
|
@ -43,23 +43,30 @@ sub check {
|
||||||
$self->{output}->output_add(long_msg => "Checking temperatures");
|
$self->{output}->output_add(long_msg => "Checking temperatures");
|
||||||
$self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0};
|
$self->{components}->{temperature} = {name => 'temperatures', total => 0, skip => 0};
|
||||||
return if ($self->check_filter(section => 'temperature'));
|
return if ($self->check_filter(section => 'temperature'));
|
||||||
|
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_drsChassisStatusGroup}, instance => '0');
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_drsChassisStatusGroup}, instance => 0);
|
||||||
|
|
||||||
foreach my $probe (keys %{$mapping}) {
|
foreach my $probe (keys %{$mapping}) {
|
||||||
next if (!defined($result->{$probe}));
|
next if (!defined($result->{$probe}));
|
||||||
|
|
||||||
next if ($self->check_filter(section => 'temperature', instance => $mapping->{$probe}->{instance}));
|
next if ($self->check_filter(section => 'temperature', instance => $mapping->{$probe}->{instance}));
|
||||||
$self->{components}->{temperature}->{total}++;
|
$self->{components}->{temperature}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("%s is %dC [instance: %s].",
|
$self->{output}->output_add(
|
||||||
$mapping->{$probe}->{descr}, $result->{$probe},
|
long_msg => sprintf(
|
||||||
$mapping->{$probe}->{instance}));
|
"%s is %dC [instance: %s].",
|
||||||
|
$mapping->{$probe}->{descr},
|
||||||
|
$result->{$probe},
|
||||||
|
$mapping->{$probe}->{instance}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $mapping->{$probe}->{instance}, value => $result->{$probe});
|
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $mapping->{$probe}->{instance}, value => $result->{$probe});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(
|
||||||
short_msg => sprintf("%s is %sC", $mapping->{$probe}->{descr}, $result->{$probe}));
|
severity => $exit,
|
||||||
|
short_msg => sprintf("%s is %sC", $mapping->{$probe}->{descr}, $result->{$probe})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'temp', unit => 'C',
|
label => 'temp', unit => 'C',
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
#
|
||||||
|
# Copyright 2021 Centreon (http://www.centreon.com/)
|
||||||
|
#
|
||||||
|
# Centreon is a full-fledged industry-strength solution that meets
|
||||||
|
# the needs in IT infrastructure and application monitoring for
|
||||||
|
# service performance.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
package hardware::server::dell::cmc::snmp::mode::components::vdisk;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $map_vdisk_status = {
|
||||||
|
1 => 'unknown', 2 => 'online',
|
||||||
|
3 => 'failed', 4 => 'degraded'
|
||||||
|
};
|
||||||
|
|
||||||
|
my $mapping = {
|
||||||
|
name => { oid => '.1.3.6.1.4.1.674.10892.2.6.1.20.140.1.1.2' }, # virtualDiskName
|
||||||
|
status => { oid => '.1.3.6.1.4.1.674.10892.2.6.1.20.140.1.1.4', map => $map_vdisk_status } # virtualDiskState
|
||||||
|
};
|
||||||
|
my $oid_vdisk_table = '.1.3.6.1.4.1.674.10892.2.6.1.20.140.1'; # virtualDiskTable
|
||||||
|
|
||||||
|
sub load {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
push @{$self->{request}}, {
|
||||||
|
oid => $oid_vdisk_table,
|
||||||
|
start => $mapping->{name}->{oid},
|
||||||
|
end => $mapping->{status}->{oid}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub check {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
$self->{output}->output_add(long_msg => "Checking vdisks");
|
||||||
|
$self->{components}->{vdisk} = { name => 'vdisks', total => 0, skip => 0 };
|
||||||
|
return if ($self->check_filter(section => 'vdisk'));
|
||||||
|
|
||||||
|
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_vdisk_table}})) {
|
||||||
|
next if ($oid !~ /^$mapping->{name}->{oid}\.(.*)$/);
|
||||||
|
my $instance = $1;
|
||||||
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_vdisk_table}, instance => $instance);
|
||||||
|
|
||||||
|
next if ($self->check_filter(section => 'vdisk', instance => $instance));
|
||||||
|
$self->{components}->{vdisk}->{total}++;
|
||||||
|
|
||||||
|
$self->{output}->output_add(
|
||||||
|
long_msg => sprintf(
|
||||||
|
"vdisk '%s' status is '%s' [instance: %s]",
|
||||||
|
$result->{name},
|
||||||
|
$result->{status},
|
||||||
|
$instance
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
my $exit = $self->get_severity(section => 'vdisk', value => $result->{status});
|
||||||
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
|
$self->{output}->output_add(
|
||||||
|
severity => $exit,
|
||||||
|
short_msg => sprintf("vdisk '%s' status is '%s'", $result->{name}, $result->{status})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
|
@ -34,18 +34,24 @@ sub set_system {
|
||||||
$self->{cb_hook2} = 'snmp_execute';
|
$self->{cb_hook2} = 'snmp_execute';
|
||||||
|
|
||||||
$self->{thresholds} = {
|
$self->{thresholds} = {
|
||||||
health => [
|
default => [
|
||||||
['other', 'UNKNOWN'],
|
['other', 'UNKNOWN'],
|
||||||
['unknown', 'UNKNOWN'],
|
['unknown', 'UNKNOWN'],
|
||||||
['ok', 'OK'],
|
['ok', 'OK'],
|
||||||
['nonCritical', 'WARNING'],
|
['nonCritical', 'WARNING'],
|
||||||
['critical', 'CRITICAL'],
|
['critical', 'CRITICAL'],
|
||||||
['nonRecoverable', 'CRITICAL']
|
['nonRecoverable', 'CRITICAL']
|
||||||
|
],
|
||||||
|
vdisk => [
|
||||||
|
['online', 'OK'],
|
||||||
|
['degraded', 'WARNING'],
|
||||||
|
['failed', 'CRITICAL'],
|
||||||
|
['unknown', 'UNKNOWN']
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
$self->{components_path} = 'hardware::server::dell::cmc::snmp::mode::components';
|
$self->{components_path} = 'hardware::server::dell::cmc::snmp::mode::components';
|
||||||
$self->{components_module} = ['health', 'chassis', 'temperature', 'psu'];
|
$self->{components_module} = ['chassis', 'disk', 'health', 'psu', 'temperature', 'vdisk'];
|
||||||
}
|
}
|
||||||
|
|
||||||
sub snmp_execute {
|
sub snmp_execute {
|
||||||
|
@ -89,14 +95,14 @@ __END__
|
||||||
|
|
||||||
=head1 MODE
|
=head1 MODE
|
||||||
|
|
||||||
Check Hardware (Health, Temperatures, Power supplies metrics and chassis metrics).
|
Check hardware.
|
||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
=item B<--component>
|
=item B<--component>
|
||||||
|
|
||||||
Which component to check (Default: '.*').
|
Which component to check (Default: '.*').
|
||||||
Can be: 'health', 'temperature', 'chassis', 'psu'.
|
Can be: 'chassis', 'disk', 'health', 'psu', 'temperature', 'vdisk'.
|
||||||
|
|
||||||
=item B<--filter>
|
=item B<--filter>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue