NAME

App::Netdisco::SSHCollector::Platform::EOS

DESCRIPTION

Collect ARP and IPv6 neighbor entries, MAC table, and connected subnet data from Arista EOS devices.

PUBLIC METHODS

arpnip($host, $ssh)

Retrieve ARP entries from device. $host is the hostname or IP address of the device. $ssh is a Net::OpenSSH connection to the device.

Returns a list of hashrefs in the format { mac => MACADDR, ip => IPADDR }. IPv4 ARP and IPv6 neighbor entries from all VRFs are flattened into one list.

arpnip_by_vrf($host, $ssh, $args)

As arpnip, used when store_vrfs is on. Names each entry's VRF from the JSON key it appears under (default is ''). A VRF is read whole only when every command that returned usable JSON listed it with its neighbor table.

Returns { entries => [ { ip, mac, vrf } ], vrf_read => { VRF => 0|1 }, vrf_list_complete => 0|1, families => [4, 6] }, or undef when neither command returned usable JSON. families names the address families vrf_read covers: [4] or [6] when only one command did (absent or malformed would mean [4]). IPv4 entries also carry iface, as in arpnip; one with no interface is still returned, without iface.

A subclass that overrides arpnip must also override arpnip_by_vrf, or with store_vrfs on this arpnip_by_vrf is used instead of the override.

macsuck($host, $ssh)

Retrieve MAC address table entries from device, skipping entries on the Router port. Returns a hashref in the format { VLAN => { PORT => { MACADDR => COUNT } } }.

subnets($host, $ssh)

Retrieve directly connected IPv4 subnets from every VRF's routing table, without host routes. Returns a list of CIDR strings such as 10.1.1.0/24.

subnets_by_vrf($host, $ssh, $args)

As subnets, used when store_vrfs is on, and reading IPv6 as well. Runs show ip route vrf all connected and show ipv6 route vrf all connected and names each prefix's VRF from the JSON key it appears under (the worker maps default to '').

Returns { VRF => [ { prefix => '10.1.1.0', len => 24 }, ... ] }, or undef when neither command returned usable JSON. A VRF with no connected routes maps to an empty list. Host routes and link-local prefixes are returned as EOS lists them: the worker filters them. A command that fails contributes nothing and the other family's prefixes are still returned.

A subclass that overrides subnets must also override subnets_by_vrf, or with store_vrfs on this subnets_by_vrf is used instead of the override.