Skip to content

Commit

Permalink
fix: Update Dell networking devices support for os10 based products
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Apr 26, 2024
1 parent 676721d commit 1ea424d
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions lib/GLPI/Agent/SNMP/MibSupport/Dell.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,37 @@ use constant productIdentificationSerialNumber => productIdentification . ".8.1
use constant productIdentificationAssetTag => productIdentification . ".8.1.3.1" ;
use constant productIdentificationServiceTag => productIdentification . ".8.1.4.1" ;

# Constant extracted from DELLEMC-OS10-SMI-MIB
use constant os10 => dell . '.11000.5000.100';

# Constant extracted from DELLEMC-OS10-PRODUCTS-MIB
use constant os10Products => os10 . '.2';

# Constant extracted from DELLEMC-OS10-CHASSIS-MIB
use constant os10ChassisMib => os10 . '.4';
use constant os10ChassisObject => os10ChassisMib . '.1.1';
use constant os10ChassisMacAddr => os10ChassisObject . '.3.1.3.1';
use constant os10ChassisPPID => os10ChassisObject . '.3.1.5.1';
use constant os10ChassisServiceTag => os10ChassisObject . '.3.1.7.1';

use English qw(-no_match_vars);
use UNIVERSAL::require;

our $mibSupport = [
{
name => "dell-powerconnect",
oid => powerConnectVendorMIB
},
{
name => "dell-os10-product",
sysobjectid => getRegexpOidMatch(os10Products)
}
];

sub getType {
return 'NETWORKING';
}

sub getFirmware {
my ($self) = @_;

Expand All @@ -53,7 +74,19 @@ sub getManufacturer {
sub getSerial {
my ($self) = @_;

return getCanonicalString($self->get(productIdentificationSerialNumber));
return getCanonicalString($self->get(productIdentificationSerialNumber))
|| getCanonicalString($self->get(os10ChassisPPID));
}

sub getMacAddress {
my ($self) = @_;

my $device = $self->device
or return;

return if $device->{MAC};

return getCanonicalMacAddress($self->get(os10ChassisMacAddr));
}

sub getModel {
Expand All @@ -75,12 +108,14 @@ sub run {

my $assettag = getCanonicalString($self->get(productIdentificationAssetTag));
if (empty($assettag) || $assettag =~ /^none$/i) {
my $servicetag = getCanonicalString($self->get(productIdentificationServiceTag));
$device->{INFO}->{ASSETTAG} = $servicetag
my $servicetag = getCanonicalString($self->get(productIdentificationServiceTag))
|| getCanonicalString($self->get(os10ChassisServiceTag));
$assettag = $servicetag
unless empty($servicetag) || $servicetag =~ /^none$/i;
} else {
$device->{INFO}->{ASSETTAG} = $assettag;
}

$device->{INFO}->{ASSETTAG} = $assettag
unless empty($assettag);
}

1;
Expand Down

0 comments on commit 1ea424d

Please sign in to comment.