mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 16:14:21 +02:00
+ Correct bladecenter IBM
This commit is contained in:
parent
c43b7cfc4e
commit
d8e5b1f26d
@ -59,7 +59,7 @@ sub check {
|
|||||||
$label = 'pureflex';
|
$label = 'pureflex';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $temp (@values) {
|
foreach my $temp (@sensors) {
|
||||||
if (!defined($self->{results}->{$oid_temperature}->{$oids->{$label}->{$temp}}) ||
|
if (!defined($self->{results}->{$oid_temperature}->{$oids->{$label}->{$temp}}) ||
|
||||||
$self->{results}->{$oid_temperature}->{$oids->{$label}->{$temp}} !~ /([0-9\.]+)/) {
|
$self->{results}->{$oid_temperature}->{$oids->{$label}->{$temp}} !~ /([0-9\.]+)/) {
|
||||||
$self->{output}->output_add(long_msg => sprintf("skip ambient '%s': no values",
|
$self->{output}->output_add(long_msg => sprintf("skip ambient '%s': no values",
|
||||||
|
@ -77,8 +77,10 @@ sub check {
|
|||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_bladeSystemStatusEntry}, instance => $instance);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_bladeSystemStatusEntry}, instance => $instance);
|
||||||
|
|
||||||
next if ($self->check_exclude(section => 'blade', instance => $result->{bladeId}));
|
next if ($self->check_exclude(section => 'blade', instance => $result->{bladeId}));
|
||||||
next if ($result->{bladeExists} =~ /No/i &&
|
if ($result->{bladeExists} =~ /No/i) {
|
||||||
$self->absent_problem(section => 'blade', instance => $result->{bladeId}));
|
$self->{output}->output_add(long_msg => "skipping blade '" . $instance . "' : not exits");
|
||||||
|
next;
|
||||||
|
}
|
||||||
$self->{components}->{blade}->{total}++;
|
$self->{components}->{blade}->{total}++;
|
||||||
|
|
||||||
if ($result->{bladePowerState} =~ /off/) {
|
if ($result->{bladePowerState} =~ /off/) {
|
||||||
|
@ -58,8 +58,8 @@ sub check {
|
|||||||
next if ($self->check_exclude(section => 'chassisfan', instance => $instance));
|
next if ($self->check_exclude(section => 'chassisfan', instance => $instance));
|
||||||
$self->{components}->{chassisfan}->{total}++;
|
$self->{components}->{chassisfan}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("Chassis fan '%s' is %d rpm [status: %s, instance: %s]",
|
$self->{output}->output_add(long_msg => sprintf("Chassis fan '%s' is %s rpm [status: %s, instance: %s]",
|
||||||
$instance, $result->{fanPackAverageSpeedRPM}, $result->{chassisFanState},
|
$instance, $result->{chassisFanSpeedRPM}, $result->{chassisFanState},
|
||||||
$instance));
|
$instance));
|
||||||
my $exit = $self->get_severity(section => 'chassisfan', value => $result->{chassisFanState});
|
my $exit = $self->get_severity(section => 'chassisfan', value => $result->{chassisFanState});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
|
@ -29,10 +29,14 @@ my %map_state = (
|
|||||||
2 => 'warning',
|
2 => 'warning',
|
||||||
3 => 'bad',
|
3 => 'bad',
|
||||||
);
|
);
|
||||||
|
my %map_exists = (
|
||||||
|
0 => 'false',
|
||||||
|
1 => 'true',
|
||||||
|
);
|
||||||
|
|
||||||
# In MIB 'mmblade.mib' and 'cme.mib'
|
# In MIB 'mmblade.mib' and 'cme.mib'
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
fanPackExists => { oid => '.1.3.6.1.4.1.2.3.51.2.2.6.1.1.2' },
|
fanPackExists => { oid => '.1.3.6.1.4.1.2.3.51.2.2.6.1.1.2', map => \%map_exists },
|
||||||
fanPackState => { oid => '.1.3.6.1.4.1.2.3.51.2.2.6.1.1.3', map => \%map_state },
|
fanPackState => { oid => '.1.3.6.1.4.1.2.3.51.2.2.6.1.1.3', map => \%map_state },
|
||||||
fanPackAverageSpeedRPM => { oid => '.1.3.6.1.4.1.2.3.51.2.2.6.1.1.6' },
|
fanPackAverageSpeedRPM => { oid => '.1.3.6.1.4.1.2.3.51.2.2.6.1.1.6' },
|
||||||
};
|
};
|
||||||
@ -56,14 +60,14 @@ sub check {
|
|||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fanPackEntry}, instance => $instance);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fanPackEntry}, instance => $instance);
|
||||||
|
|
||||||
if ($result->{fanPackExists} == 1) {
|
if ($result->{fanPackExists} =~ /No/i) {
|
||||||
$self->{output}->output_add(long_msg => "skipping fanpack '" . $instance . "' : not exits");
|
$self->{output}->output_add(long_msg => "skipping fanpack '" . $instance . "' : not exits");
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
next if ($self->check_exclude(section => 'fanpack', instance => $instance));
|
next if ($self->check_exclude(section => 'fanpack', instance => $instance));
|
||||||
$self->{components}->{fanpack}->{total}++;
|
$self->{components}->{fanpack}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("Fanpack '%s' is %d rpm [status: %s, instance: %s]",
|
$self->{output}->output_add(long_msg => sprintf("Fanpack '%s' is %s rpm [status: %s, instance: %s]",
|
||||||
$instance, $result->{fanPackAverageSpeedRPM}, $result->{fanPackState},
|
$instance, $result->{fanPackAverageSpeedRPM}, $result->{fanPackState},
|
||||||
$instance));
|
$instance));
|
||||||
my $exit = $self->get_severity(section => 'fanpack', value => $result->{fanPackState});
|
my $exit = $self->get_severity(section => 'fanpack', value => $result->{fanPackState});
|
||||||
|
@ -49,6 +49,7 @@ sub check {
|
|||||||
return if ($self->check_exclude(section => 'switchmodule'));
|
return if ($self->check_exclude(section => 'switchmodule'));
|
||||||
|
|
||||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping->{smHealthState}->{oid}}})) {
|
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$mapping->{smHealthState}->{oid}}})) {
|
||||||
|
$oid =~ /^$mapping->{smHealthState}->{oid}\.(.*)/;
|
||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{smHealthState}->{oid}}, instance => $instance);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{smHealthState}->{oid}}, instance => $instance);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user