NAME
SNMP::Info::Layer3::Nexus - SNMP Interface to Cisco Nexus Switches running NX-OS
AUTHOR
Eric Miller
SYNOPSIS
# Let SNMP::Info determine the correct subclass for you.
my $nexus = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
# These arguments are passed directly to SNMP::Session
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $nexus->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
DESCRIPTION
Abstraction subclass for Cisco Nexus Switches running NX-OS.
For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above.
my $nexus = new SNMP::Info::Layer3::Nexus(...);
Inherited Classes
Required MIBs
- Inherited Classes' MIBs
-
See "Required MIBs" in SNMP::Info::Layer3::CiscoSwitch for its own MIB requirements.
GLOBALS
These are methods that return a scalar value from SNMP
- $nexus->os()
-
Returns
'nx-os' - $nexus->os_ver()
-
Returns operating system version extracted from
sysDescr. - $nexus->serial()
-
Returns the serial number of the chassis from ENTITY-MIB.
- $nexus->model()
-
Tries to reference $nexus->id() to CISCO-ENTITY-VENDORTYPE-OID-MIB
Removes
'cevChassis'for readability. - $nexus->mac()
-
dot1dBaseBridgeAddress - $nexus->context_kinds($feature)
-
See
context_kinds()in SNMP::Info. Returns['vlan', 'mst']forstp, and['vlan']forfdb, and['vrf']forvrf. - $nexus->snmp_context($kind, $id)
-
See
snmp_context()in SNMP::Info. NX-OS serves VLAN and MST contexts over SNMPv3 only, sov2cis undef for both kinds:vlan-
The context
vlan-Nfor VLAN N. mst-
The context
mst-Nfor MST instance N, only wherecContextMappingTablelists it, which it does only under MST.mst-0serves the CIST'sdot1dStpPortTable, which the default context does not.cist.0still hasports_complete0 ("Spanning Tree Trees" in SNMP::Info::CiscoStpExtensions).
For
vrf,$idis a name fromvrf_instances()and the answer is{ kind => 'vrf', id => $name, v2c => undef, v3 => $context }.$contextis a contextcContextMappingTablemaps to the VRF, chosen in this order:the context named like the VRF, if it is mapped to the VRF;
else the lowest sorted name among the contexts mapped to the VRF;
else the VRF name itself.
Nothing is returned for:
the default VRF and an empty name, which have no context;
a VRF with no mapped context whose name is a context mapped to another VRF. Its
contextsinvrf_instances()is then empty.
v2cis undef: NX-OS reaches a VRF over SNMPv2c only through a site's community map (snmp-server mib community-map), whose community the class cannot derive. A session on such a community reads as the context its ownsnmpCommunityTablerow names (seevrf_comm_name()). The readers accept it where that is the contextsnmp_context('vrf', $name)gives. Where the row is not served, the session reads as the default context; read VRF contexts over SNMPv3.VRF reads use context mode (see "Reading Instances" in SNMP::Info::VRF). Each VRF context serves only that VRF's address rows, but
ifTableis not scoped, and the default context serves the IPv6 neighbors of every VRF's ports. The readers therefore keep only the rows on ports holding an address in the current context.cContextMappingTablelists the VRFs. Any row it serves listsdefault, so a device that maps only VLAN or MST contexts reportsvrf_instances_complete()1, none configured (see "Completeness" in SNMP::Info::VRF).
Overrides
IP Address Table
Each entry in this table is an IP address in use on this device. Some versions do not index the table with the IPv4 address in accordance with the MIB definition, these overrides correct that behavior.
Also, the table is augmented with IP addresses in use by UDP sockets on the device, as determined by checking RFC1213-MIB::udpLocalAddress. Valid addresses from this table (any IPv4 that is not localhost, 0.0.0.0, Class D (multicast) or Class E (experimental) are added as a /32 on interface ID 0. This is a workaround to determine possible VPC Keepalive IP addresses on the device, which are probably advertised by CDP/LLDP to neighbors.
- $nexus->ip_index()
-
Maps the IP Table to the IID
(
ipAdEntIfIndex) - $nexus->ip_table()
-
Maps the Table to the IP address
(
ipAdEntAddr) - $nexus->ip_netmask()
-
Gives netmask setting for IP table entry.
(
ipAdEntNetMask) - $nexus->ip_broadcast()
-
Gives broadcast address for IP table entry.
(
ipAdEntBcastAddr) - $nexus->lldp_lport_desc()
-
On nx-os 6 only this will return data from
lldpLocPortIdinstead of the expectedlldpLocPortDesc. For all other nx-os versions uses the function from SNMP::Info::LLDP.
Globals imported from SNMP::Info::Layer3::CiscoSwitch
See documentation in "GLOBALS" in SNMP::Info::Layer3::CiscoSwitch for details.
TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash.
SNMP Community Table (snmpCommunityTable)
- $nexus->vrf_comm_name()
-
Returns reference to hash of community strings, keyed by the length-prefixed
snmpCommunityIndex. NX-OS serves the community only on the row the session itself uses, and an empty string on every other row.(
snmpCommunityName) - $nexus->vrf_comm_context()
-
Returns reference to hash of the SNMP context each community row maps to, keyed as
vrf_comm_name(): empty for the default context, a context name for a community set bysnmp-server mib community-map.(
snmpCommunityContextName)
Link Aggregation
- $nexus->lag_groups()
-
As described in "METHODS" in SNMP::Info::IEEE802dot3ad, with:
mcon the channel named by each vPC host link (cVpcStatusHostLinkIfIndex):kindvpc,groupthe vPC id,domainthe vPC domain id, andstatethe host link status (cVpcStatusHostLinkStatus).peer_linkon the channel named bycVpcStatusPeerLinkIfIndex.A static channel has no IEEE8023-LAG-MIB row:
lacpis 0 and the actor and partner fields are undef.
- $nexus->mlag_domains()
-
As described in "METHODS" in SNMP::Info::IEEE802dot3ad, keyed by vPC domain id (
cVpcRoleTable), withkindvpcand these fields:system_mac:cVpcSystemOperMacAddress.role:cVpcRoleStatus.peer: the peer keepalive destination,cVpcPeerKeepAliveDestAddr.peer_link:cVpcStatusPeerLinkIfIndex.status: the peer keepalive status,cVpcPeerKeepAliveStatus.
vPC Tables (CISCO-VPC-MIB)
- $nexus->vpc_role()
-
(
cVpcRoleStatus) - $nexus->vpc_system_mac()
-
(
cVpcSystemOperMacAddress) - $nexus->vpc_keepalive_peer()
-
(
cVpcPeerKeepAliveDestAddr) - $nexus->vpc_keepalive_stat()
-
(
cVpcPeerKeepAliveStatus) - $nexus->vpc_peer_link()
-
(
cVpcStatusPeerLinkIfIndex) - $nexus->vpc_host_link_if()
-
(
cVpcStatusHostLinkIfIndex) - $nexus->vpc_host_link_stat()
-
(
cVpcStatusHostLinkStatus)
Table Methods imported from SNMP::Info::Layer3::CiscoSwitch
See documentation in "TABLE METHODS" in SNMP::Info::Layer3::CiscoSwitch for details.