optimize huawei ibmc

This commit is contained in:
garnier-quentin 2019-10-16 14:26:06 +02:00
parent 639e6d4080
commit b0b2613aa7
8 changed files with 44 additions and 14 deletions

View File

@ -33,15 +33,19 @@ my %map_status = (
);
my $mapping = {
cpuStatus => { oid => '.1.3.6.1.4.1.2011.2.235.1.1.15.50.1.6', map => \%map_status },
cpuDevicename => { oid => '.1.3.6.1.4.1.2011.2.235.1.1.15.50.1.10' },
cpuStatus => { oid => '.1.3.6.1.4.1.2011.2.235.1.1.15.50.1.6', map => \%map_status },
cpuDevicename => { oid => '.1.3.6.1.4.1.2011.2.235.1.1.15.50.1.10' },
};
my $oid_cpuDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.15.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_cpuDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_cpuDescriptionEntry,
start => $mapping->{cpuStatus}->{oid},
end => $mapping->{cpuDevicename}->{oid},
};
}
sub check {
@ -72,4 +76,4 @@ sub check {
}
}
1;
1;

View File

@ -49,7 +49,11 @@ my $oid_hardDiskDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.18.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_hardDiskDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_hardDiskDescriptionEntry,
start => $mapping->{hardDiskPresence}->{oid},
end => $mapping->{hardDiskTemperature}->{oid},
};
}
sub check {

View File

@ -41,7 +41,10 @@ my $oid_logicalDriveDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.37.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_logicalDriveDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_logicalDriveDescriptionEntry,
end => $mapping->{logicalDriveState}->{oid},
};
}
sub check {

View File

@ -41,7 +41,11 @@ my $oid_memoryDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.16.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_memoryDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_memoryDescriptionEntry,
start => $mapping->{memoryStatus}->{oid},
end => $mapping->{memoryDevicename}->{oid},
};
}
sub check {
@ -72,4 +76,4 @@ sub check {
}
}
1;
1;

View File

@ -48,7 +48,11 @@ my $oid_pCIeDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.24.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_pCIeDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_pCIeDescriptionEntry,
start => $mapping->{pCIePresence}->{oid},
end => $mapping->{pCIeDevicename}->{oid},
};
}
sub check {
@ -79,4 +83,4 @@ sub check {
}
}
1;
1;

View File

@ -50,7 +50,10 @@ my $oid_powerSupplyDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.6.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_powerSupplyDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_powerSupplyDescriptionEntry,
start => $mapping->{powerSupplyPowerRating}->{oid},
};
}
sub check {

View File

@ -24,15 +24,19 @@ use strict;
use warnings;
my $mapping = {
raidControllerHealthStatus => { oid => '.1.3.6.1.4.1.2011.2.235.1.1.36.50.1.7' },
raidControllerComponentName => { oid => '.1.3.6.1.4.1.2011.2.235.1.1.36.50.1.4' },
raidControllerHealthStatus => { oid => '.1.3.6.1.4.1.2011.2.235.1.1.36.50.1.7' },
};
my $oid_raidControllerDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.36.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_raidControllerDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_raidControllerDescriptionEntry,
start => $mapping->{raidControllerComponentName}->{oid},
end => $mapping->{raidControllerHealthStatus}->{oid},
};
}
sub check {

View File

@ -32,7 +32,11 @@ my $oid_temperatureDescriptionEntry = '.1.3.6.1.4.1.2011.2.235.1.1.26.50.1';
sub load {
my ($self) = @_;
push @{$self->{request}}, { oid => $oid_temperatureDescriptionEntry };
push @{$self->{request}}, {
oid => $oid_temperatureDescriptionEntry,
start => $mapping->{temperatureObject}->{oid},
end => $mapping->{temperatureReading}->{oid},
};
}
sub check {