* We meant well but it turns out that the array unnest and join is
actually very slow, as the join arguments do not get pushed down
into the CTE (in Postgres 9/10 at least, later versions remove some
of the optimization barriers in that specifc type of query)
* This caused a seq scan on both device and device_port, and the query
is executed many times during macsuck
* The query is now rewritten to use ANY (macaddr[]) and without CTE,
which seems to be around 20x faster
* The previous module only worked for 32-bit IOSXR, and already
there some fiddling with the STDIN of the process was required
when being run from netdisco-backend
* In 64-bit IOSXR, the STDIN workaround stopped working and
created a stuck ssh process on every arpnip
* This new version uses Expect instead of plain SSH, so a proper
pty is provided under any circumstances
* Successfully tested on recent 32- and 64-bit variants
Hi @ollyg! Unfortunately I have found some issues with the code we
finally released in #680:
* get_port_macs expects an array ref but values() returns array,
so the code was never called due to the return unless... check
* When fw_mac_list had exactly two entries, only the second value
was bound as a scalar to the parameter. This is probably due
to the shorthand bind formats described in
https://metacpan.org/pod/DBIx::Class::ResultSet#DBIC-BIND-VALUES,
but I'm not a 100% on this.
* return unless now checks for an entry in the list, with the old
check the statement was also executed for empty lists
In cases where only the device(_port)?.mac lookup worked for uplink
detection, users of 02.044005 - 010 might get a lot of uplinks not
labeled as such.
This module works for Extreme (formerly Avaya) VSP switches running the
VOSS operating system. When using multiple VRFs, the default Arpnip does
not work.
The way to query the ARP tables of different VRFs is to append "::X" to
the end of the SNMP community string, where "X" is the VRF ID number.
Since Netdisco doesn't support querying with multiple community strings
at this time, this module uses SSH to query the ARP tables of all the
VRFs by default or select VRFs using the "vrfs" key in "device_auth"
(see documentation in the module for an example).
* Reduce macsuck bandwidth usage to database
get_port_macs transfers a full list of all device_port.(mac,ip) in every macsuck.
With 8k devices and 40k interfaces it takes up around 15MB. Transferring them 8k times
during an 1h macsuck cycle requires bandwidth in the 300 to 400 mbit/s range.
This patch changes get_port_macs to be called inside walk_fwtable and only transfer
the macs found in the current target device/vlan.
* On e.g. Cisco N9K, ipv6 objects can be returned undef which crashes the ip alias discovery with `Can't use an undefined value as a HASH reference at .../Discover/Properties.pm line 346.`
* Discovery continues but leaves device_ip empty, which in turn makes device->neighbor non-functional
* Fixed by adding various `$snmp->x || {}` safeguards
this patch resets all pseudo devices to have no layer3 support but adds a
feature to the pseudo devices admin panel to enable layer3 support. it also
changes arpnip and arpwalk behaviour to always permit the action if layer3
is available (ignoring the vendor).
documentation will need updating to tell users to create pseudo devices
with layer3 support when they want to arpnip an unsupported platform.
arpnip with ssh/cli against a supported platform (one that can be discovered)
will continue to work normally.
Squashed commit of the following:
commit 9dad5be81d
Author: Oliver Gorwits <oliver@cpan.org>
Date: Tue Sep 3 09:03:53 2019 +0100
allow pseudo with layer 3 to run arpnip
commit 7d97943fcd
Author: Oliver Gorwits <oliver@cpan.org>
Date: Tue Sep 3 08:59:10 2019 +0100
allow pseudo devices with layer 2/3 capability
commit d1fdf574e3
Author: Oliver Gorwits <oliver@cpan.org>
Date: Tue Sep 3 08:55:41 2019 +0100
move pseudo and layer checks to is_able from is_able_now
commit e0f72ef67d
Author: Oliver Gorwits <oliver@cpan.org>
Date: Tue Sep 3 08:51:42 2019 +0100
ports defaults to one
commit 86ba01270c
Author: Oliver Gorwits <oliver@cpan.org>
Date: Tue Sep 3 08:50:45 2019 +0100
add tooltip for arpnip toggle
commit cdd2470228
Author: Oliver Gorwits <oliver@cpan.org>
Date: Tue Sep 3 08:34:46 2019 +0100
simplify template
commit 46236d68ea
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Sep 1 23:53:56 2019 +0100
a fix up for pseudo devices which need layer 3
commit 016d249efc
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Sep 1 20:37:11 2019 +0100
do not wrap buttons
commit 1ec1402e0c
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Sep 1 20:33:03 2019 +0100
implement user settable layer-three service for pseudo devices
commit a267efa3d8
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Sep 1 18:39:22 2019 +0100
only set layer if successful action
commit b108be5e23
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Sep 1 18:32:19 2019 +0100
should defer SNMP against pseudo devices
commit 897ba3a629
Merge: e0ddbaaba7348900
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Sep 1 14:54:36 2019 +0100
Merge branch 'master' into og-pseudo-vs-cli-arpnip
commit e0ddbaab08
Author: Oliver Gorwits <oliver@cpan.org>
Date: Mon Aug 26 11:35:13 2019 +0100
as last commit, for discover
commit 61f9c89040
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Aug 25 23:55:38 2019 +0100
move pseudo and layer checks into is_*able functions
commit 8b010d4023
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Aug 25 18:38:11 2019 +0100
any device completing macsuck/arpnip must have that layer
commit a11bce7863
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Aug 25 18:33:27 2019 +0100
clean up device layers
commit d2661bff61
Author: Oliver Gorwits <oliver@cpan.org>
Date: Sun Aug 25 18:18:02 2019 +0100
first make arpnip behave like other jobs towards pseudo devices