NAME
App::Netdisco::SSHCollector::Platform::IOSXR
DESCRIPTION
Collect ARP entries from Cisco IOS-XR routers using Expect, and, with store_vrfs on, IPv6 neighbor entries as well. Suitable for both 32- and 64-bit IOS-XR.
PUBLIC METHODS
- arpnip($host, $ssh)
-
Retrieve ARP entries from device.
$hostis the hostname or IP address of the device.$sshis a Net::OpenSSH connection to the device.Returns a list of hashrefs in the format
{ mac => MACADDR, ip => IPADDR }. - arpnip_by_vrf($host, $ssh, $args)
-
As
arpnip, used whenstore_vrfsis on. Readsshow vrf all, then the globalshow arpandshow ipv6 neighborsand, for each listed VRF,show arp vrf NAMEand, when the globalshow ipv6 neighborsanswered,show ipv6 neighbors vrf NAME. Each entry's VRF is the one it was read from (the global table is''). The globalshow ipv6 neighborsalso lists VRF neighbors, so its entries carrymixed => 1. The router's own addresses (stateInterface) are kept, asarpnipkeeps them.Returns
{ entries => [ { ip, mac, vrf } ], vrf_read => { VRF => 0|1 }, vrf_list_complete => 0|1, families => [4, 6] }, or undef when the session orshow vrf allfails.familiesis[4]when the globalshow ipv6 neighborsdid not answer cleanly (IPv6 is unsupported or unreached), and thenvrf_readcovers IPv4 only; otherwise it is[4, 6]. A table is read whole when it returned to the prompt with no%orInvalidline and every line was a timestamp, a header, a location, an entry or a multicast adjacency. A VRF is 1 only when its table for every family infamilieswas read whole, so a VRF whose IPv6 table fails is 0 though its IPv4 entries are reported. A VRF that is empty, misspelled or unknown prints nothing, so an empty table reads as whole. A VRF list row that cannot be parsed into a name makesvrf_list_complete0, and a VRF name outside[A-Za-z0-9_.:-]or equal toallis 0 with no command sent. Only a VRF named exactlydefaultis skipped as the global table;Defaultis a user VRF. Ashow vrf allthat returned with its header and no VRF is a whole, empty list. After a timeout the rest of the session is not read, and that VRF and every one not yet read are 0.A subclass that overrides
arpnipmust also overridearpnip_by_vrf, or withstore_vrfson thisarpnip_by_vrfis used instead of the override.