SNMP::...::SONMP(3pm)

🌈 SNMP::...::SONMP πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation corner of the world, where this lil page lives as SNMP::...::SONMP(3pm). pull up a chair, grab a boba, and let's talk about talking to switches 🫢

✨ NAME ✨

SNMP::Info::SONMP β€” the SNMP Interface to SynOptics Network Management Protocol (SONMP). that's it, that's the whole vibe. πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

Eric Miller. iconic of them honestly. 🌟

πŸŽ€ SYNOPSIS πŸŽ€

here's the whole flow, copy it exactly, don't freestyle:

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";

$hassonmp   = $sonmp->hasSONMP() ? 'yes' : 'no';

# Print out a map of device ports with SONMP neighbors:
my $interfaces     = $sonmp->interfaces();
my $sonmp_if       = $sonmp->sonmp_if();
my $sonmp_ip       = $sonmp->sonmp_ip();
my $sonmp_port     = $sonmp->sonmp_port();

foreach my $sonmp_key (keys %$sonmp_ip){
   my $iid           = $sonmp_if->{$sonmp_key};
   my $port          = $interfaces->{$iid};
   my $neighbor      = $sonmp_ip->{$sonmp_key};
   my $neighbor_port = $sonmp_port->{$sonmp_key};
   print "Port : $port connected to $neighbor / $neighbor_port\n";
}

like, that loop is literally mapping your ports to their neighbors and printing it. chef's kiss. 😭✨

πŸ’œ DESCRIPTION πŸ’œ

so SNMP::Info::SONMP is a subclass of SNMP::Info, and what it gives you is an object oriented interface to the SynOptics Network Management Protocol (SONMP) info, pulled through SNMP. no cap.

SONMP itself is a Layer 2 protocol that hands you topology information about devices that also speak SONMP β€” mostly switches and hubs. 🌸 it's implemented in SynOptics, Bay, Nortel, and Avaya devices. and because rebrands are chaotic, SONMP got rebranded by Bay, then by Nortel, so it goes by several different names, including Nortel Discovery Protocol (NDP). same protocol, new outfit, we love a rebrand era πŸ’…

bestie listen: create or use a device subclass that inherits this class. Do not use directly. periodt.

every device implements a subset of the global and cache entries β€” so like, check the return value to see if that data is actually held by the device. don't assume, okay? πŸ™ˆ

🧚 Inherited Classes 🧚

None. that's right, nothing inherited. it's giving self-made. πŸ’€

🌈 Required MIBs 🌈

  • SYNOPTICS-ROOT-MIB
  • S5-ETH-MULTISEG-TOPOLOGY-MIB

those two are non-negotiable, bestie.


⭐ GLOBALS ⭐

these are methods that return scalar values from SNMP. one value, one moment, very main character energy πŸ‘‘

  • $sonmp->index_factor() β€” returns a number representing the number of ports reserved per slot or switch within the device MIB. defaults to 32.
  • $sonmp->slot_offset() β€” returns the offset if slot numbering does not start at 0. defaults to 1.
  • $sonmp->port_offset() β€” returns the offset if port numbering does not start at 0. defaults to 0.
  • $sonmp->hasSONMP() β€” is SONMP is active in this device? πŸ€”
  • $sonmp->sonmp_gid() β€” returns the IP that the device is sending out for its Nmm topology info. ("s5EnMsTopIpAddr")
  • $sonmp->sonmp_run() β€” returns true if SONMP is on for this device. ("s5EnMsTopStatus")
  • $sonmp->mac() β€” returns MAC of the advertised IP address of this device. πŸ¦‹

πŸ”₯ TABLE METHODS πŸ”₯

these ones return tables of information, and the way they do it is by handing you a reference to a hash. so much data. so organized. we love structure πŸ’–

🌸 Layer2 Topology info ("s5EnMsTopNmmTable") 🌸

  • $sonmp->sonmp_topo_slot() β€” returns reference to hash. Key: Table entry, Value: slot number. ("s5EnMsTopNmmSlot")
  • $sonmp->sonmp_topo_port() β€” returns reference to hash. Key: Table entry, Value: Port Number (interface iid). ("s5EnMsTopNmmPort")
  • $sonmp->sonmp_topo_ip() β€” returns reference to hash. Key: Table entry, Value: Remote IP address of entry. ("s5EnMsTopNmmIpAddr")
  • $sonmp->sonmp_topo_seg() β€” returns reference to hash. Key: Table entry, Value: Remote Segment ID. ("s5EnMsTopNmmSegId")
  • $sonmp->sonmp_topo_mac() β€” ("s5EnMsTopNmmMacAddr") returns reference to hash. Key: Table entry, Value: Remote MAC address.
  • $sonmp->sonmp_topo_platform β€” returns reference to hash. Key: Table entry, Value: Remote Device Type. ("s5EnMsTopNmmChassisType")
  • $sonmp->sonmp_topo_localseg β€” returns reference to hash. Key: Table entry, Value: Boolean, if bay_topo_seg() is local. ("s5EnMsTopNmmLocalSeg")

πŸ¦‹ Layer2 Topology info ("s5EnMsTopNmmEnhancedTable") πŸ¦‹

  • $sonmp->sonmp_topo_e_mac() β€” ("s5EnMsTopNmmEnhancedMacAddr") returns reference to hash. Key: Table entry, Value: Remote MAC address.
  • $sonmp->sonmp_topo_e_platform β€” returns reference to hash. Key: Table entry, Value: Remote Device Type. ("s5EnMsTopNmmEnhancedChassisType")

πŸ’… Common topology information πŸ’…

heads up bestie: all entries with port=0 are local and ignored. they get filtered out, no drama. πŸ’€
  • $sonmp->sonmp_if() β€” returns reference to hash. Key: IID, Value: Local port (interfaces).
  • $sonmp->sonmp_ip() β€” returns reference to hash. Key: IID, Value: Remote IP address.
okay so this one has a lil lore 🫢: if multiple entries exist with the same local port, sonmp_if(), with different IPv4 addresses, sonmp_ip(), then there is either a non SONMP device in between two or more devices, or multiple devices which are not directly connected. use the data from the Layer2 Topology Table above to dig deeper. πŸ”
  • $sonmp->sonmp_port() β€” returns reference to hash. Key: IID, Value: Remote port (interfaces).
  • $sonmp->sonmp_platform() β€” returns reference to hash. Key: IID, Value: Remote device type.

okay that's the whole page, you ate it, you understood it, your topology is now fully mapped and your neighbors are known πŸ’–

and now the cute lil sign-off our source page had, so you know where this all came from: this is perl v5.40.1, dated 2026-02-28, and it's the page for SNMP::...::SONMP(3pm). ✨ go forth and SNMP responsibly, bestie πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from