From 368f1d6a1e0cecd7f14865a31b3781bc4c0e5ef4 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Mon, 24 Jul 2017 15:53:40 +0200 Subject: [PATCH] add peer type bgp nokia --- network/nokia/timos/snmp/mode/listbgp.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/network/nokia/timos/snmp/mode/listbgp.pm b/network/nokia/timos/snmp/mode/listbgp.pm index bee07f50d..fc07a6960 100644 --- a/network/nokia/timos/snmp/mode/listbgp.pm +++ b/network/nokia/timos/snmp/mode/listbgp.pm @@ -45,9 +45,11 @@ sub check_options { my %map_status = (1 => 'unknown', 2 => 'inService', 3 => 'outOfService', 4 => 'transition', 5 => 'disabled', ); +my %map_type = (1 => 'noType', 2 => 'internal', 3 => 'external'); my $oid_vRtrName = '.1.3.6.1.4.1.6527.3.1.2.3.1.1.4'; my $mapping = { tBgpPeerNgDescription => { oid => '.1.3.6.1.4.1.6527.3.1.2.14.4.7.1.7' }, + tBgpPeerNgPeerType => { oid => '.1.3.6.1.4.1.6527.3.1.2.14.4.7.1.27', map => \%map_type }, tBgpPeerNgOperStatus => { oid => '.1.3.6.1.4.1.6527.3.1.2.14.4.7.1.42', map => \%map_status }, tBgpPeerNgPeerAS4Byte => { oid => '.1.3.6.1.4.1.6527.3.1.2.14.4.7.1.66' }, }; @@ -58,6 +60,7 @@ sub manage_selection { my $snmp_result = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_vRtrName }, { oid => $mapping->{tBgpPeerNgOperStatus}->{oid} }, + { oid => $mapping->{tBgpPeerNgPeerType}->{oid} }, { oid => $mapping->{tBgpPeerNgDescription}->{oid} }, { oid => $mapping->{tBgpPeerNgPeerAS4Byte}->{oid} }, ], return_type => 1, nothing_quit => 1); @@ -70,7 +73,7 @@ sub manage_selection { my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $vrtr_id . '.' . $peer_type . '.' . $peer_addr); $self->{bgp}->{$vrtr_id . '.' . $peer_type . '.' . $peer_addr} = { - vrtr_name => $vrtr_name, + vrtr_name => $vrtr_name, peer_type => $result->{tBgpPeerNgPeerType}, peer_addr => $peer_addr, peer_as => $result->{tBgpPeerNgPeerAS4Byte}, status => $result->{tBgpPeerNgOperStatus}, description => $result->{tBgpPeerNgDescription} }; } @@ -84,6 +87,7 @@ sub run { $self->{output}->output_add(long_msg => '[vrtr_name = ' . $self->{bgp}->{$instance}->{vrtr_name} . "] [peer_addr = '" . $self->{bgp}->{$instance}->{peer_addr} . "'] [peer_as = '" . $self->{bgp}->{$instance}->{peer_as} . + "'] [peer_type = '" . $self->{bgp}->{$instance}->{peer_type} . "'] [description = '" . $self->{bgp}->{$instance}->{description} . "'] [status = '" . $self->{bgp}->{$instance}->{status} . '"]'); @@ -98,7 +102,7 @@ sub run { sub disco_format { my ($self, %options) = @_; - $self->{output}->add_disco_format(elements => ['vrtr_name', 'peer_addr', 'peer_as', 'status', 'description']); + $self->{output}->add_disco_format(elements => ['vrtr_name', 'peer_addr', 'peer_as', 'peer_type', 'status', 'description']); } sub disco_show { @@ -109,6 +113,7 @@ sub disco_show { $self->{output}->add_disco_entry(vrtr_name => $self->{bgp}->{$instance}->{vrtr_name}, peer_addr => $self->{bgp}->{$instance}->{peer_addr}, peer_as => $self->{bgp}->{$instance}->{peer_as}, + peer_type => $self->{bgp}->{$instance}->{peer_type}, status => $self->{bgp}->{$instance}->{status}, description => $self->{bgp}->{$instance}->{description}, );