SNMP::Info::SONMP - Perl5 Interface to SynOptics Network Management Protocol (SONMP) using SNMP
Max Baker (max@warped.org),
Eric Miller (eric@jeneric.org)
my $sonmp = new SNMP::Info (
AutoSpecify => 1,
Debug => 1,
DestHost => 'router',
Community => 'public',
Version => 2
);
my $class = $sonmp->class(); print " Using device sub class : $class\n";
$hascdp = $sonmp->hasCDP() ? 'yes' : 'no';
# Print out a map of device ports with CDP neighbors: my $interfaces = $sonmp->interfaces(); my $c_if = $sonmp->c_if(); my $c_ip = $sonmp->c_ip(); my $c_port = $sonmp->c_port();
foreach my $cdp_key (keys %$c_ip){
my $iid = $c_if->{$cdp_key};
my $port = $interfaces->{$iid};
my $neighbor = $c_ip->{$cdp_key};
my $neighbor_port = $c_port->{$cdp_key};
print "Port : $port connected to $neighbor / $neighbor_port\n";
}
SNMP::Info::SONMP is a subclass of SNMP::Info that provides an object oriented interface to the SynOptics Network Management Protocol (SONMP) information through SNMP.
SONMP is a Layer 2 protocol that supplies topology information of devices that also speak SONMP, mostly switches and hubs. SONMP is implemented in SynOptics, Bay, and Nortel Networks devices. SONMP has been rebranded by Bay then Nortel Networks and is know by several different names.
Create or use a device subclass that inherits this class. Do not use directly.
Each device implements a subset of the global and cache entries. Check the return value to see if that data is held by the device.
None.
MIBs can be found on the CD that came with your product.
Or, they can be downloaded directly from Nortel Networks regardless of support contract status.
Go to http://www.nortelnetworks.com Techninal Support, Browse Technical Support, Select by product, Java Device Manager, Software. Download the latest version. After installation, all mibs are located under the install directory under mibs and the repspective product line.
Note: Required version of SYNOPTICS-ROOT-MIB, must be version 199 or higher, for example synro199.mib.
These are methods that return scalar values from SNMP
index_factor()slot_offset()port_offset()hasCDP()cdp_id()(s5EnMsTopIpAddr)
cdp_run()(s5EnMsTopStatus)
mac()
These are methods that return tables of information in the form of a reference to a hash.
sonmp_topo_slot()(s5EnMsTopNmmSlot)
sonmp_topo_port()(s5EnMsTopNmmPort)
sonmp_topo_ip()(s5EnMsTopNmmIpAddr)
sonmp_topo_seg()(s5EnMsTopNmmSegId)
Returns reference to hash. Key: Table entry, Value:Remote MAC address
(s5EnMsTopNmmChassisType)
bay_topo_seg() is local
(s5EnMsTopNmmLocalSeg)
All entries with port=0 are local and ignored.
c_if()c_ip()The value of each hash entry can either be a scalar or an array. A scalar value is most likely a direct neighbor to that port. It is possible that there is a non-SONMP device in between this device and the remote device.
An array value represents a list of seen devices. The only time you will get an array of neighbors, is if there is a non-SONMP device in between two or more devices.
Use the data from the Layer2 Topology Table below to dig deeper.
c_port()c_platform()