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

SNMP::Info::Layer3::CiscoSwitch

Required MIBs

CISCO-ENTITY-VENDORTYPE-OID-MIB
CISCO-CONTEXT-MAPPING-MIB
SNMP-COMMUNITY-MIB
CISCO-VPC-MIB
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'] for stp, and ['vlan'] for fdb, and ['vrf'] for vrf.

$nexus->snmp_context($kind, $id)

See snmp_context() in SNMP::Info. NX-OS serves VLAN and MST contexts over SNMPv3 only, so v2c is undef for both kinds:

vlan

The context vlan-N for VLAN N.

mst

The context mst-N for MST instance N, only where cContextMappingTable lists it, which it does only under MST. mst-0 serves the CIST's dot1dStpPortTable, which the default context does not. cist.0 still has ports_complete 0 ("Spanning Tree Trees" in SNMP::Info::CiscoStpExtensions).

For vrf, $id is a name from vrf_instances() and the answer is { kind => 'vrf', id => $name, v2c => undef, v3 => $context }. $context is a context cContextMappingTable maps 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 contexts in vrf_instances() is then empty.

v2c is 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 own snmpCommunityTable row names (see vrf_comm_name()). The readers accept it where that is the context snmp_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 ifTable is 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.

cContextMappingTable lists the VRFs. Any row it serves lists default, so a device that maps only VLAN or MST contexts reports vrf_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 lldpLocPortId instead of the expected lldpLocPortDesc. 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 by snmp-server mib community-map.

(snmpCommunityContextName)

$nexus->lag_groups()

As described in "METHODS" in SNMP::Info::IEEE802dot3ad, with:

  • mc on the channel named by each vPC host link (cVpcStatusHostLinkIfIndex): kind vpc, group the vPC id, domain the vPC domain id, and state the host link status (cVpcStatusHostLinkStatus).

  • peer_link on the channel named by cVpcStatusPeerLinkIfIndex.

  • A static channel has no IEEE8023-LAG-MIB row: lacp is 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), with kind vpc and 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)

(cVpcStatusHostLinkIfIndex)

(cVpcStatusHostLinkStatus)

Table Methods imported from SNMP::Info::Layer3::CiscoSwitch

See documentation in "TABLE METHODS" in SNMP::Info::Layer3::CiscoSwitch for details.