typo(cisco/wlc): discovery

This commit is contained in:
garnier-quentin 2021-08-04 11:23:38 +02:00
parent 5b75e9ca37
commit c9f5242c81
1 changed files with 17 additions and 17 deletions

View File

@ -32,8 +32,8 @@ sub new {
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
"filter-admin-down" => { name => 'filter_admin_down' }, 'filter-admin-down' => { name => 'filter_admin_down' },
"prettify" => { name => 'prettify' }, 'prettify' => { name => 'prettify' }
}); });
return $self; return $self;
@ -55,14 +55,13 @@ my $map_operation_status = {
}; };
my $mapping = { my $mapping = {
ap_name => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.3' }, # bsnAPName ap_name => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.3' }, # bsnAPName
ap_ipaddr => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.19' }, #bsnApIpAddress ap_ipaddr => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.19' } # bsnApIpAddress
}; };
my $mapping2 = { my $mapping2 = {
opstatus => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.6', map => $map_operation_status }, # bsnAPOperationStatus opstatus => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.6', map => $map_operation_status }, # bsnAPOperationStatus
admstatus => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.37', map => $map_admin_status } # bsnAPAdminStatus admstatus => { oid => '.1.3.6.1.4.1.14179.2.2.1.1.37', map => $map_admin_status } # bsnAPAdminStatus
}; };
my $oid_agentInventoryMachineModel = '.1.3.6.1.4.1.14179.1.1.1.3'; my $oid_agentInventoryMachineModel = '.1.3.6.1.4.1.14179.1.1.1.3';
sub run { sub run {
@ -74,10 +73,11 @@ sub run {
$disco_stats->{start_time} = time(); $disco_stats->{start_time} = time();
my $request = [ { oid => $oid_agentInventoryMachineModel }, my $request = [
{ oid => $mapping->{ap_name}->{oid} }, { oid => $oid_agentInventoryMachineModel },
{ oid => $mapping->{ap_ipaddr}->{oid} } ]; { oid => $mapping->{ap_name}->{oid} },
{ oid => $mapping->{ap_ipaddr}->{oid} }
];
my $snmp_result = $options{snmp}->get_multiple_table( my $snmp_result = $options{snmp}->get_multiple_table(
oids => $request, oids => $request,
return_type => 1, return_type => 1,
@ -97,9 +97,8 @@ sub run {
name => $result->{ap_name}, name => $result->{ap_name},
instance => $instance, instance => $instance,
ip => $result->{ap_ipaddr}, ip => $result->{ap_ipaddr},
model => (defined($snmp_result->{$oid_agentInventoryMachineModel . '.0'}) ? model => defined($snmp_result->{$oid_agentInventoryMachineModel . '.0'}) ?
$snmp_result->{$oid_agentInventoryMachineModel . '.0'} : $snmp_result->{$oid_agentInventoryMachineModel . '.0'} : 'unknown'
'unknown')
}; };
} }
@ -115,7 +114,8 @@ sub run {
my $result = $options{snmp}->map_instance( my $result = $options{snmp}->map_instance(
mapping => $mapping2, mapping => $mapping2,
results => $snmp_result, results => $snmp_result,
instance => $self->{ap}->{ $ap_name }->{instance}); instance => $self->{ap}->{ $ap_name }->{instance}
);
$self->{ap}->{ $ap_name }->{admstatus} = $result->{admstatus}; $self->{ap}->{ $ap_name }->{admstatus} = $result->{admstatus};
$self->{ap}->{ $ap_name }->{opstatus} = $result->{opstatus}; $self->{ap}->{ $ap_name }->{opstatus} = $result->{opstatus};