SNMP::Info::Layer3::Dell - Take in count OS10 (#491)
With the version 10.x of Del switches, the MIB have changed. So, I have updated the Dell module to retrieve correctly: - the model type - the FAN status - the PSU status
This commit is contained in:
@@ -49,12 +49,19 @@ $VERSION = '3.94';
|
|||||||
'RADLAN-HWENVIROMENT' => 'rlEnvPhysicalDescription',
|
'RADLAN-HWENVIROMENT' => 'rlEnvPhysicalDescription',
|
||||||
'Dell-Vendor-MIB' => 'productIdentificationVersion',
|
'Dell-Vendor-MIB' => 'productIdentificationVersion',
|
||||||
'DELL-REF-MIB' => 'dell6224Switch',
|
'DELL-REF-MIB' => 'dell6224Switch',
|
||||||
|
|
||||||
|
# For DELL-OS10 devices
|
||||||
|
'DELLEMC-OS10-PRODUCTS-MIB' => 'os10Products',
|
||||||
|
'DELLEMC-OS10-CHASSIS-MIB' => 'os10SysObject',
|
||||||
);
|
);
|
||||||
|
|
||||||
%GLOBALS = (
|
%GLOBALS = (
|
||||||
%SNMP::Info::Layer3::GLOBALS,
|
%SNMP::Info::Layer3::GLOBALS,
|
||||||
'dell_os_ver' => 'productIdentificationVersion',
|
'dell_os_ver' => 'productIdentificationVersion',
|
||||||
'dell_id_name' => 'productIdentificationDisplayName',
|
'dell_id_name' => 'productIdentificationDisplayName',
|
||||||
|
|
||||||
|
# For DELL-OS10
|
||||||
|
'dell_os10_id_name' => 'os10ChassisType',
|
||||||
);
|
);
|
||||||
|
|
||||||
%FUNCS = (
|
%FUNCS = (
|
||||||
@@ -102,6 +109,15 @@ $VERSION = '3.94';
|
|||||||
# RADLAN-HWENVIROMENT:rlEnvMonFanStatusTable
|
# RADLAN-HWENVIROMENT:rlEnvMonFanStatusTable
|
||||||
'dell_fan_state' => 'rlEnvMonFanState',
|
'dell_fan_state' => 'rlEnvMonFanState',
|
||||||
'dell_fan_desc' => 'rlEnvMonFanStatusDescr',
|
'dell_fan_desc' => 'rlEnvMonFanStatusDescr',
|
||||||
|
|
||||||
|
# DELLEMC-OS10-CHASSIS-MIB:os10PowerSupplyTable
|
||||||
|
'dell_os10_pwr_src' => 'os10PowerSupplyType',
|
||||||
|
'dell_os10_pwr_state' => 'os10PowerSupplyOperStatus',
|
||||||
|
|
||||||
|
# DELLEMC-OS10-CHASSIS-MIB:os10FanTable
|
||||||
|
'dell_os10_fan_state' => 'os10FanOperStatus',
|
||||||
|
'dell_os10_fan_ent' => 'os10FanEntity',
|
||||||
|
'dell_os10_fan_slot' => 'os10FanEntitySlot',
|
||||||
);
|
);
|
||||||
|
|
||||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
||||||
@@ -112,10 +128,13 @@ sub model {
|
|||||||
my $dell = shift;
|
my $dell = shift;
|
||||||
|
|
||||||
my $name = $dell->dell_id_name();
|
my $name = $dell->dell_id_name();
|
||||||
|
my $os10_name = $dell->dell_os10_id_name();
|
||||||
my $id = $dell->id();
|
my $id = $dell->id();
|
||||||
|
|
||||||
if ( defined $name and $name =~ m/(\d+)/ ) {
|
if ( defined $name and $name =~ m/(\d+)/ ) {
|
||||||
return $1;
|
return $1;
|
||||||
|
} elsif (defined $os10_name) {
|
||||||
|
return $os10_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return unless defined $id;
|
return unless defined $id;
|
||||||
@@ -163,6 +182,9 @@ sub fan {
|
|||||||
|
|
||||||
my $fan = $dell->dell_fan_desc() || {};
|
my $fan = $dell->dell_fan_desc() || {};
|
||||||
my $state = $dell->dell_fan_state() || {};
|
my $state = $dell->dell_fan_state() || {};
|
||||||
|
my $os10_fan_ent = $dell->dell_os10_fan_ent() || {};
|
||||||
|
my $os10_fan_slot = $dell->dell_os10_fan_slot() || {};
|
||||||
|
my $os10_state = $dell->dell_os10_fan_state() || {};
|
||||||
|
|
||||||
if (scalar keys %$fan) {
|
if (scalar keys %$fan) {
|
||||||
my @messages = ();
|
my @messages = ();
|
||||||
@@ -175,6 +197,17 @@ sub fan {
|
|||||||
push @messages, ((scalar keys %$fan). " fans OK")
|
push @messages, ((scalar keys %$fan). " fans OK")
|
||||||
if scalar @messages == 0;
|
if scalar @messages == 0;
|
||||||
|
|
||||||
|
return (join ", ", @messages);
|
||||||
|
} elsif (scalar keys %$os10_fan_ent) {
|
||||||
|
my @messages = ();
|
||||||
|
|
||||||
|
foreach my $k (keys %$os10_fan_ent) {
|
||||||
|
next if $os10_state->{$k} and $os10_state->{$k} eq 'up';
|
||||||
|
push @messages, "$os10_fan_ent->{$k}_$os10_fan_slot->{$k}: $os10_state->{$k}";
|
||||||
|
}
|
||||||
|
|
||||||
|
push @messages, ((scalar keys %$os10_fan_ent). " fans OK");
|
||||||
|
|
||||||
return (join ", ", @messages);
|
return (join ", ", @messages);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -183,7 +216,7 @@ sub fan {
|
|||||||
sub ps1_type {
|
sub ps1_type {
|
||||||
my $dell = shift;
|
my $dell = shift;
|
||||||
|
|
||||||
my $src = $dell->dell_pwr_src() || {};
|
my $src = $dell->dell_pwr_src() || $dell->dell_os10_pwr_src() || {};
|
||||||
|
|
||||||
foreach my $k (sort keys %$src) {
|
foreach my $k (sort keys %$src) {
|
||||||
next unless $src->{$k};
|
next unless $src->{$k};
|
||||||
@@ -195,7 +228,7 @@ sub ps1_type {
|
|||||||
sub ps2_type {
|
sub ps2_type {
|
||||||
my $dell = shift;
|
my $dell = shift;
|
||||||
|
|
||||||
my $src = $dell->dell_pwr_src() || {};
|
my $src = $dell->dell_pwr_src() || $dell->dell_os10_pwr_src() || {};
|
||||||
|
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
foreach my $k (sort keys %$src) {
|
foreach my $k (sort keys %$src) {
|
||||||
@@ -209,7 +242,7 @@ sub ps2_type {
|
|||||||
sub ps1_status {
|
sub ps1_status {
|
||||||
my $dell = shift;
|
my $dell = shift;
|
||||||
|
|
||||||
my $status = $dell->dell_pwr_state() || {};
|
my $status = $dell->dell_pwr_state() || $dell->dell_os10_pwr_state() || {};
|
||||||
|
|
||||||
foreach my $k (sort keys %$status) {
|
foreach my $k (sort keys %$status) {
|
||||||
next unless $status->{$k};
|
next unless $status->{$k};
|
||||||
@@ -221,7 +254,7 @@ sub ps1_status {
|
|||||||
sub ps2_status {
|
sub ps2_status {
|
||||||
my $dell = shift;
|
my $dell = shift;
|
||||||
|
|
||||||
my $status = $dell->dell_pwr_state() || {};
|
my $status = $dell->dell_pwr_state() || $dell->dell_os10_pwr_state() || {};
|
||||||
|
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
foreach my $k (sort keys %$status) {
|
foreach my $k (sort keys %$status) {
|
||||||
|
|||||||
Reference in New Issue
Block a user