Merge branch 'master' into og-api-tokens
This commit is contained in:
@@ -16,17 +16,18 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
||||
my $snmp = App::Netdisco::Transport::SNMP->reader_for($device)
|
||||
or return Status->defer("discover failed: could not SNMP connect to $device");
|
||||
|
||||
my $ospf_peers = $snmp->ospf_peers || {};
|
||||
my $bgp_peers = $snmp->bgp_peer_addr || {};
|
||||
my $eigrp_peers = $snmp->eigrp_peers || {};
|
||||
my $ospf_peers = $snmp->ospf_peers || {};
|
||||
my $ospf_routers = $snmp->ospf_peer_id || {};
|
||||
my $bgp_peers = $snmp->bgp_peer_addr || {};
|
||||
my $eigrp_peers = $snmp->eigrp_peers || {};
|
||||
|
||||
return Status->info(" [$device] neigh - no BGP, OSPF, or EIGRP peers")
|
||||
unless ((scalar values %$ospf_peers) or (scalar values %$bgp_peers)
|
||||
or (scalar values %$eigrp_peers));
|
||||
|
||||
my $count = 0;
|
||||
foreach my $ip ((values %$ospf_peers), (values %$bgp_peers),
|
||||
(values %$eigrp_peers)) {
|
||||
foreach my $ip ((values %$ospf_peers), (values %$ospf_routers),
|
||||
(values %$bgp_peers), (values %$eigrp_peers)) {
|
||||
my $peer = get_device($ip);
|
||||
next if $peer->in_storage or not is_discoverable($peer);
|
||||
next if vars->{'queued'}->{$ip};
|
||||
|
||||
@@ -181,6 +181,13 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
|
||||
next;
|
||||
}
|
||||
|
||||
# Skip interfaces which are 'notPresent' and match the notpresent type filter
|
||||
if (defined $i_up->{$entry} and defined $i_type->{$entry} and $i_up->{$entry} eq 'notPresent' and (scalar grep {$i_type->{$entry} =~ m/^$_$/} @{setting('ignore_notpresent_types') || []}) ) {
|
||||
debug sprintf ' [%s] interfaces - ignoring %s (%s) (%s) (config:ignore_notpresent_types)',
|
||||
$device->ip, $entry, $port, $i_up->{$entry};
|
||||
next;
|
||||
}
|
||||
|
||||
my $lc = $i_lastchange->{$entry} || 0;
|
||||
if (not $dev_uptime_wrapped and $lc > $dev_uptime) {
|
||||
info sprintf ' [%s] interfaces - device uptime wrapped (%s) - correcting',
|
||||
@@ -263,7 +270,7 @@ sub _get_vrf_list {
|
||||
if ($vrf =~ /^\S+$/) {
|
||||
my $ctx_name = pack("C*",split(/\./,$idx));
|
||||
$ctx_name =~ s/.*[^[:print:]]+//;
|
||||
debug sprintf(' [%s] Discover VRF %s with SNMP Context %s', $device->ip, $vrf, $ctx_name);
|
||||
debug sprintf(' [%s] Discover VRF %s with SNMP Context %s', $device->ip, $vrf, $ctx_name);
|
||||
push (@ok_vrfs, $ctx_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@ register_worker({ phase => 'main' }, sub {
|
||||
|
||||
true;
|
||||
|
||||
=encoding utf8
|
||||
|
||||
=head1 NAME
|
||||
|
||||
MakeRancidConf - Generate RANCID Configuration
|
||||
|
||||
Reference in New Issue
Block a user