diff --git a/network/alcatel/omniswitch/snmp/mode/components/backplane.pm b/network/alcatel/omniswitch/snmp/mode/components/backplane.pm index 03a5851df..6d85150d7 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/backplane.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/backplane.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'backplane')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 4) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 4) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'backplane', instance => $instance)); $self->{components}->{backplane}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/chassis.pm b/network/alcatel/omniswitch/snmp/mode/components/chassis.pm index 82bf73d3c..ac30eb754 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/chassis.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/chassis.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'chassis')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 3) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 3) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'chassis', instance => $instance)); $self->{components}->{chassis}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/container.pm b/network/alcatel/omniswitch/snmp/mode/components/container.pm index f3853cbbb..1f273be04 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/container.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/container.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'container')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 5) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 5) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'container', instance => $instance)); $self->{components}->{container}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/fan.pm b/network/alcatel/omniswitch/snmp/mode/components/fan.pm index f290066f9..2fbb60733 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/fan.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/fan.pm @@ -40,17 +40,17 @@ sub check { return if ($self->check_filter(section => 'fan')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 7) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 7) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'fan', instance => $instance)); $self->{components}->{fan}->{total}++; @@ -84,14 +84,14 @@ sub check { } } - foreach my $key (keys %{$self->{results}->{$oids{alaChasEntPhysFanStatus}}}) { - next if ($key !~ /^$oids{alaChasEntPhysFanStatus}\.(.*?)\.(.*?)$/); + foreach my $key (keys %{$self->{results}->{$oids{$self->{type}}->{alaChasEntPhysFanStatus}}}) { + next if ($key !~ /^$oids{$self->{type}}->{alaChasEntPhysFanStatus}\.(.*?)\.(.*?)$/); my ($phys_index, $loc_index) = ($1, $2); - my $status = $self->{results}->{$oids{alaChasEntPhysFanStatus}}->{$key}; - my $descr = defined($self->{results}->{entity}->{$oids{entPhysicalDescr} . '.' . $phys_index}) ? - $self->{results}->{entity}->{$oids{entPhysicalDescr} . '.' . $phys_index} : 'unknown'; - my $name = defined($self->{results}->{entity}->{$oids{entPhysicalName} . '.' . $phys_index}) ? - $self->{results}->{entity}->{$oids{entPhysicalName} . '.' . $phys_index} : 'unknown'; + my $status = $self->{results}->{$oids{$self->{type}}->{alaChasEntPhysFanStatus}}->{$key}; + my $descr = defined($self->{results}->{entity}->{$oids{common}->{entPhysicalDescr} . '.' . $phys_index}) ? + $self->{results}->{entity}->{$oids{common}->{entPhysicalDescr} . '.' . $phys_index} : 'unknown'; + my $name = defined($self->{results}->{entity}->{$oids{common}->{entPhysicalName} . '.' . $phys_index}) ? + $self->{results}->{entity}->{$oids{common}->{entPhysicalName} . '.' . $phys_index} : 'unknown'; next if ($self->check_filter(section => 'fan', instance => $phys_index . '.' . $loc_index)); $self->{components}->{fan}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/module.pm b/network/alcatel/omniswitch/snmp/mode/components/module.pm index 3a638aeff..7daadc983 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/module.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/module.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'module')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 9) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 9) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'module', instance => $instance)); $self->{components}->{module}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/other.pm b/network/alcatel/omniswitch/snmp/mode/components/other.pm index eccd11d53..1dd3a8a36 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/other.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/other.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'other')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 1) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 1) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'other', instance => $instance)); $self->{components}->{other}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/port.pm b/network/alcatel/omniswitch/snmp/mode/components/port.pm index b3a3ddf5f..80eadc3c9 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/port.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/port.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'port')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 10) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 10) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'port', instance => $instance)); $self->{components}->{port}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/psu.pm b/network/alcatel/omniswitch/snmp/mode/components/psu.pm index 01204b79e..e54dc61a0 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/psu.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/psu.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'psu')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 6) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 6) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/resources.pm b/network/alcatel/omniswitch/snmp/mode/components/resources.pm index 75efd53d6..753d560be 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/resources.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/resources.pm @@ -57,7 +57,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $ 7 => 'unpowered', 8 => 'master', 9 => 'idle', - 10 => 'unpoweredLicMismatch', + 10 => 'pwrsave', ); %phys_admin_status = ( @@ -70,29 +70,58 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $ 7 => 'standby', 8 => 'resetWithFabric', 9 => 'takeoverWithFabrc', + 10 => 'vcTakeover', + 11 => 'resetVcAll', ); %oids = ( - entPhysicalDescr => '.1.3.6.1.2.1.47.1.1.1.1.2', - entPhysicalClass => '.1.3.6.1.2.1.47.1.1.1.1.5', - entPhysicalName => '.1.3.6.1.2.1.47.1.1.1.1.7', - chasEntPhysAdminStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.1', - chasEntPhysOperStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.2', - chasEntPhysPower => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.4', + common => { + entPhysicalDescr => '.1.3.6.1.2.1.47.1.1.1.1.2', + entPhysicalClass => '.1.3.6.1.2.1.47.1.1.1.1.5', + entPhysicalName => '.1.3.6.1.2.1.47.1.1.1.1.7', + }, + aos6 => { + entreprise_alcatel_base => '.1.3.6.1.4.1.6486.800', + + chasEntPhysAdminStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.1', + chasEntPhysOperStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.2', + chasEntPhysPower => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.4', - chasHardwareBoardTemp => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.4', - chasTempThreshold => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.7', - chasDangerTempThreshold => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.8', + chasHardwareBoardTemp => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.4', + chasTempThreshold => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.7', + chasDangerTempThreshold => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.8', - alaChasEntPhysFanStatus => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.11.1.2', + alaChasEntPhysFanStatus => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.11.1.2', + }, + aos7 => { + entreprise_alcatel_base => '.1.3.6.1.4.1.6486.801', + + chasEntPhysAdminStatus => '1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.1', + chasEntPhysOperStatus => '1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.2', + chasEntPhysPower => '1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.3', + + chasTempThreshold => '1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.5', + chasDangerTempThreshold => '1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.6', + + alaChasEntPhysFanStatus => '1.3.6.1.4.1.6486.801.1.1.1.3.1.1.11.1.2', + }, ); $mapping = { - entPhysicalDescr => { oid => $oids{entPhysicalDescr} }, - entPhysicalName => { oid => $oids{entPhysicalName} }, - chasEntPhysAdminStatus => { oid => $oids{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' }, - chasEntPhysOperStatus => { oid => $oids{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' }, - chasEntPhysPower => { oid => $oids{chasEntPhysPower}, default => -1 }, + aos6 => { + entPhysicalDescr => { oid => $oids{common}->{entPhysicalDescr} }, + entPhysicalName => { oid => $oids{common}->{entPhysicalName} }, + chasEntPhysAdminStatus => { oid => $oids{aos6}->{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' }, + chasEntPhysOperStatus => { oid => $oids{aos6}->{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' }, + chasEntPhysPower => { oid => $oids{aos6}->{chasEntPhysPower}, default => -1 }, + }, + aos7 => { + entPhysicalDescr => { oid => $oids{common}->{entPhysicalDescr} }, + entPhysicalName => { oid => $oids{common}->{entPhysicalName} }, + chasEntPhysAdminStatus => { oid => $oids{aos7}->{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' }, + chasEntPhysOperStatus => { oid => $oids{aos7}->{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' }, + chasEntPhysPower => { oid => $oids{aos7}->{chasEntPhysPower}, default => -1 }, + }, }; -1; \ No newline at end of file +1; diff --git a/network/alcatel/omniswitch/snmp/mode/components/sensor.pm b/network/alcatel/omniswitch/snmp/mode/components/sensor.pm index 3c12e0135..832c1c0a7 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/sensor.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/sensor.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'sensor')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 8) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 8) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'sensor', instance => $instance)); $self->{components}->{sensor}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/stack.pm b/network/alcatel/omniswitch/snmp/mode/components/stack.pm index 3876abb68..5f7939720 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/stack.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/stack.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'stack')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 11) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 11) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'stack', instance => $instance)); $self->{components}->{stack}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/components/unknown.pm b/network/alcatel/omniswitch/snmp/mode/components/unknown.pm index 907d91812..a42975909 100644 --- a/network/alcatel/omniswitch/snmp/mode/components/unknown.pm +++ b/network/alcatel/omniswitch/snmp/mode/components/unknown.pm @@ -34,17 +34,17 @@ sub check { return if ($self->check_filter(section => 'unknown')); my @instances = (); - foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) { - if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 2) { - next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/); + foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) { + if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 2) { + next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/); push @instances, $1; } } foreach my $instance (@instances) { - next if (!defined($self->{results}->{entity}->{$oids{chasEntPhysAdminStatus} . '.' . $instance})); + next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}->{chasEntPhysAdminStatus} . '.' . $instance})); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{entity}, instance => $instance); + my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); next if ($self->check_filter(section => 'unknown', instance => $instance)); $self->{components}->{unknown}->{total}++; diff --git a/network/alcatel/omniswitch/snmp/mode/hardware.pm b/network/alcatel/omniswitch/snmp/mode/hardware.pm index b588d1a15..4ec73fc53 100644 --- a/network/alcatel/omniswitch/snmp/mode/hardware.pm +++ b/network/alcatel/omniswitch/snmp/mode/hardware.pm @@ -61,16 +61,28 @@ sub snmp_execute { $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => [ - { oid => $oids{entPhysicalClass} }, - { oid => $oids{alaChasEntPhysFanStatus} }, + { oid => $oids{common}->{entPhysicalClass} }, + { oid => $oids{aos6}->{alaChasEntPhysFanStatus} }, + { oid => $oids{aos7}->{alaChasEntPhysFanStatus} }, ]); $self->{results}->{entity} = $self->{snmp}->get_multiple_table(oids => [ - { oid => $oids{entPhysicalDescr} }, - { oid => $oids{entPhysicalName} }, - { oid => $oids{chasEntPhysAdminStatus} }, - { oid => $oids{chasEntPhysOperStatus} }, - { oid => $oids{chasEntPhysPower} }, + { oid => $oids{common}->{entPhysicalDescr} }, + { oid => $oids{common}->{entPhysicalName} }, + { oid => $oids{aos6}->{chasEntPhysAdminStatus} }, + { oid => $oids{aos6}->{chasEntPhysOperStatus} }, + { oid => $oids{aos6}->{chasEntPhysPower} }, + { oid => $oids{aos7}->{chasEntPhysAdminStatus} }, + { oid => $oids{aos7}->{chasEntPhysOperStatus} }, + { oid => $oids{aos7}->{chasEntPhysPower} }, ], return_type => 1); + + $self->{type} = 'aos6'; + foreach (keys %{$self->{results}->{entity}}) { + if (/^$oids{aos7}->{entreprise_alcatel_base}\./) { + $self->{type} = 'aos7'; + last; + } + } } sub new {