Enhance alcatel omniswitch hardware for new version
This commit is contained in:
parent
e8fa409bb8
commit
90a2427c13
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'backplane'));
|
return if ($self->check_filter(section => 'backplane'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 4) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 4) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'backplane', instance => $instance));
|
||||||
$self->{components}->{backplane}->{total}++;
|
$self->{components}->{backplane}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'chassis'));
|
return if ($self->check_filter(section => 'chassis'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 3) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 3) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'chassis', instance => $instance));
|
||||||
$self->{components}->{chassis}->{total}++;
|
$self->{components}->{chassis}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'container'));
|
return if ($self->check_filter(section => 'container'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 5) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 5) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'container', instance => $instance));
|
||||||
$self->{components}->{container}->{total}++;
|
$self->{components}->{container}->{total}++;
|
||||||
|
|
|
@ -40,17 +40,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'fan'));
|
return if ($self->check_filter(section => 'fan'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 7) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 7) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'fan', instance => $instance));
|
||||||
$self->{components}->{fan}->{total}++;
|
$self->{components}->{fan}->{total}++;
|
||||||
|
@ -84,14 +84,14 @@ sub check {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{alaChasEntPhysFanStatus}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{$self->{type}}->{alaChasEntPhysFanStatus}}}) {
|
||||||
next if ($key !~ /^$oids{alaChasEntPhysFanStatus}\.(.*?)\.(.*?)$/);
|
next if ($key !~ /^$oids{$self->{type}}->{alaChasEntPhysFanStatus}\.(.*?)\.(.*?)$/);
|
||||||
my ($phys_index, $loc_index) = ($1, $2);
|
my ($phys_index, $loc_index) = ($1, $2);
|
||||||
my $status = $self->{results}->{$oids{alaChasEntPhysFanStatus}}->{$key};
|
my $status = $self->{results}->{$oids{$self->{type}}->{alaChasEntPhysFanStatus}}->{$key};
|
||||||
my $descr = defined($self->{results}->{entity}->{$oids{entPhysicalDescr} . '.' . $phys_index}) ?
|
my $descr = defined($self->{results}->{entity}->{$oids{common}->{entPhysicalDescr} . '.' . $phys_index}) ?
|
||||||
$self->{results}->{entity}->{$oids{entPhysicalDescr} . '.' . $phys_index} : 'unknown';
|
$self->{results}->{entity}->{$oids{common}->{entPhysicalDescr} . '.' . $phys_index} : 'unknown';
|
||||||
my $name = defined($self->{results}->{entity}->{$oids{entPhysicalName} . '.' . $phys_index}) ?
|
my $name = defined($self->{results}->{entity}->{$oids{common}->{entPhysicalName} . '.' . $phys_index}) ?
|
||||||
$self->{results}->{entity}->{$oids{entPhysicalName} . '.' . $phys_index} : 'unknown';
|
$self->{results}->{entity}->{$oids{common}->{entPhysicalName} . '.' . $phys_index} : 'unknown';
|
||||||
|
|
||||||
next if ($self->check_filter(section => 'fan', instance => $phys_index . '.' . $loc_index));
|
next if ($self->check_filter(section => 'fan', instance => $phys_index . '.' . $loc_index));
|
||||||
$self->{components}->{fan}->{total}++;
|
$self->{components}->{fan}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'module'));
|
return if ($self->check_filter(section => 'module'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 9) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 9) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'module', instance => $instance));
|
||||||
$self->{components}->{module}->{total}++;
|
$self->{components}->{module}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'other'));
|
return if ($self->check_filter(section => 'other'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 1) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 1) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'other', instance => $instance));
|
||||||
$self->{components}->{other}->{total}++;
|
$self->{components}->{other}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'port'));
|
return if ($self->check_filter(section => 'port'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 10) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 10) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'port', instance => $instance));
|
||||||
$self->{components}->{port}->{total}++;
|
$self->{components}->{port}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'psu'));
|
return if ($self->check_filter(section => 'psu'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 6) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 6) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'psu', instance => $instance));
|
||||||
$self->{components}->{psu}->{total}++;
|
$self->{components}->{psu}->{total}++;
|
||||||
|
|
|
@ -57,7 +57,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
|
||||||
7 => 'unpowered',
|
7 => 'unpowered',
|
||||||
8 => 'master',
|
8 => 'master',
|
||||||
9 => 'idle',
|
9 => 'idle',
|
||||||
10 => 'unpoweredLicMismatch',
|
10 => 'pwrsave',
|
||||||
);
|
);
|
||||||
|
|
||||||
%phys_admin_status = (
|
%phys_admin_status = (
|
||||||
|
@ -70,29 +70,58 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
|
||||||
7 => 'standby',
|
7 => 'standby',
|
||||||
8 => 'resetWithFabric',
|
8 => 'resetWithFabric',
|
||||||
9 => 'takeoverWithFabrc',
|
9 => 'takeoverWithFabrc',
|
||||||
|
10 => 'vcTakeover',
|
||||||
|
11 => 'resetVcAll',
|
||||||
);
|
);
|
||||||
|
|
||||||
%oids = (
|
%oids = (
|
||||||
entPhysicalDescr => '.1.3.6.1.2.1.47.1.1.1.1.2',
|
common => {
|
||||||
entPhysicalClass => '.1.3.6.1.2.1.47.1.1.1.1.5',
|
entPhysicalDescr => '.1.3.6.1.2.1.47.1.1.1.1.2',
|
||||||
entPhysicalName => '.1.3.6.1.2.1.47.1.1.1.1.7',
|
entPhysicalClass => '.1.3.6.1.2.1.47.1.1.1.1.5',
|
||||||
chasEntPhysAdminStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.1',
|
entPhysicalName => '.1.3.6.1.2.1.47.1.1.1.1.7',
|
||||||
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',
|
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',
|
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',
|
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',
|
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 = {
|
$mapping = {
|
||||||
entPhysicalDescr => { oid => $oids{entPhysicalDescr} },
|
aos6 => {
|
||||||
entPhysicalName => { oid => $oids{entPhysicalName} },
|
entPhysicalDescr => { oid => $oids{common}->{entPhysicalDescr} },
|
||||||
chasEntPhysAdminStatus => { oid => $oids{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' },
|
entPhysicalName => { oid => $oids{common}->{entPhysicalName} },
|
||||||
chasEntPhysOperStatus => { oid => $oids{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' },
|
chasEntPhysAdminStatus => { oid => $oids{aos6}->{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' },
|
||||||
chasEntPhysPower => { oid => $oids{chasEntPhysPower}, default => -1 },
|
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;
|
1;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'sensor'));
|
return if ($self->check_filter(section => 'sensor'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 8) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 8) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'sensor', instance => $instance));
|
||||||
$self->{components}->{sensor}->{total}++;
|
$self->{components}->{sensor}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'stack'));
|
return if ($self->check_filter(section => 'stack'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 11) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 11) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'stack', instance => $instance));
|
||||||
$self->{components}->{stack}->{total}++;
|
$self->{components}->{stack}->{total}++;
|
||||||
|
|
|
@ -34,17 +34,17 @@ sub check {
|
||||||
return if ($self->check_filter(section => 'unknown'));
|
return if ($self->check_filter(section => 'unknown'));
|
||||||
|
|
||||||
my @instances = ();
|
my @instances = ();
|
||||||
foreach my $key (keys %{$self->{results}->{$oids{entPhysicalClass}}}) {
|
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||||
if ($self->{results}->{$oids{entPhysicalClass}}->{$key} == 2) {
|
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 2) {
|
||||||
next if ($key !~ /^$oids{entPhysicalClass}\.(.*)$/);
|
next if ($key !~ /^$oids{common}->{entPhysicalClass}\.(.*)$/);
|
||||||
push @instances, $1;
|
push @instances, $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $instance (@instances) {
|
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));
|
next if ($self->check_filter(section => 'unknown', instance => $instance));
|
||||||
$self->{components}->{unknown}->{total}++;
|
$self->{components}->{unknown}->{total}++;
|
||||||
|
|
|
@ -61,16 +61,28 @@ sub snmp_execute {
|
||||||
|
|
||||||
$self->{snmp} = $options{snmp};
|
$self->{snmp} = $options{snmp};
|
||||||
$self->{results} = $self->{snmp}->get_multiple_table(oids => [
|
$self->{results} = $self->{snmp}->get_multiple_table(oids => [
|
||||||
{ oid => $oids{entPhysicalClass} },
|
{ oid => $oids{common}->{entPhysicalClass} },
|
||||||
{ oid => $oids{alaChasEntPhysFanStatus} },
|
{ oid => $oids{aos6}->{alaChasEntPhysFanStatus} },
|
||||||
|
{ oid => $oids{aos7}->{alaChasEntPhysFanStatus} },
|
||||||
]);
|
]);
|
||||||
$self->{results}->{entity} = $self->{snmp}->get_multiple_table(oids => [
|
$self->{results}->{entity} = $self->{snmp}->get_multiple_table(oids => [
|
||||||
{ oid => $oids{entPhysicalDescr} },
|
{ oid => $oids{common}->{entPhysicalDescr} },
|
||||||
{ oid => $oids{entPhysicalName} },
|
{ oid => $oids{common}->{entPhysicalName} },
|
||||||
{ oid => $oids{chasEntPhysAdminStatus} },
|
{ oid => $oids{aos6}->{chasEntPhysAdminStatus} },
|
||||||
{ oid => $oids{chasEntPhysOperStatus} },
|
{ oid => $oids{aos6}->{chasEntPhysOperStatus} },
|
||||||
{ oid => $oids{chasEntPhysPower} },
|
{ oid => $oids{aos6}->{chasEntPhysPower} },
|
||||||
|
{ oid => $oids{aos7}->{chasEntPhysAdminStatus} },
|
||||||
|
{ oid => $oids{aos7}->{chasEntPhysOperStatus} },
|
||||||
|
{ oid => $oids{aos7}->{chasEntPhysPower} },
|
||||||
], return_type => 1);
|
], return_type => 1);
|
||||||
|
|
||||||
|
$self->{type} = 'aos6';
|
||||||
|
foreach (keys %{$self->{results}->{entity}}) {
|
||||||
|
if (/^$oids{aos7}->{entreprise_alcatel_base}\./) {
|
||||||
|
$self->{type} = 'aos7';
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
|
|
Loading…
Reference in New Issue