SNMP::...Entity(3pm)

πŸ’– SNMP::Info::Entity πŸ’–

okay bestie, welcome to SNMP::Info::Entity β€” it's the SNMP interface to all the data hanging out inside ENTITY-MIB, straight outta RFC 2737. And yes, the whole page lives in the SNMP::...Entity(3pm) slot in the Perl manual, but we're not doing boring headers today, we're doing lore. ✨

Written by Max Baker. Iconic behavior only. πŸŽ€


🌸 SYNOPSIS 🌸

# Let SNMP::Info determine the correct subclass for you.
my $entity = new SNMP::Info(
                         AutoSpecify => 1,
                         Debug       => 1,
                         DestHost    => 'myswitch',
                         Community   => 'public',
                         Version     => 2
                       )
   or die "Can't connect to DestHost.\n";

my $class      = $entity->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";

πŸ¦‹ DESCRIPTION πŸ¦‹

So ENTITY-MIB is the girlies' choice for Layer 2 devices from Brocade, Cisco, HP, and honestly a whole bunch more. πŸ’…

If you want the FULL tea, go read RFC 2737. It's giving documentation. πŸ“š

✨ Real talk: create or use a device subclass that inherits this class. Do not use this one directly, bestie. It's not that kind of class.

Unless πŸ‘€ β€” for debugging purposes you can call this class directly, exactly like you'd call SNMP::Info:

my $entity = new SNMP::Info::Entity (...);

🧬 Inherited Classes

  • none.

Not a single one. Bloop. 🫧

πŸ“¦ Required MIBs

  • ENTITY-MIB

That's the one. Load it or it's not gonna work, no cap. 🌟


⭐ GLOBALS ⭐

  • none.

Empty. Void. The vibes are immaculate and also completely absent. πŸ’€


πŸ‘‘ TABLE METHODS πŸ‘‘

These are the methods that hand you back tables of info in the form of a reference to a hash. Yes, a hash. We love a hash. πŸ“

  • $entity->entity_derived_serial() β€” tries to sus out the device serial number from the ENTITY-MIB. It's picky tho: it only considers serial numbers for entries that have no parent, or for entries that are of type chassis. It peeks at "entPhysicalSerialNum" first, and then "entPhysicalDescr", hunting for that serial number. πŸ”
  • $entity->entity_derived_os_ver() β€” same energy, but for the device OS version from the ENTITY-MIB. Same rules: only considers serial numbers for entries without a parent, or entries that are of type chassis. It looks at "entPhysicalSoftwareRev" for the version. 🧠

πŸŽ€ Entity Table πŸŽ€

  • $entity->e_index() β€” Index. Literally the index, bestie. ("entPhysicalIndex")
  • $entity->e_alias() β€” human entered, not usually used. It's a decorative alias, a little hat for your entity. 🎩 ("entPhysicalAlias")
  • $entity->e_class() β€” Stack, Module, Container, Port ... you get the vibe, it's the class of the thing. ("entPhysicalClass")
  • $entity->e_descr() β€” human friendly. 🫢 ("entPhysicalClass")
  • $entity->e_fwver() β€” the firmware revision, slay. ("entPhysicalFirmwareRev")
  • $entity->e_fru() β€” BOOLEAN. Is it a Field Replaceable unit? Yes or no, no in-between. πŸ’… ("entPhysicalFRU")
  • $entity->e_hwver() β€” hardware rev, periodt. ("entPhysicalHardwareRev")
  • $entity->e_id() β€” this one's human entered and not normally used. It's the asset ID that lives in a spreadsheet from 2009. πŸ™ˆ ("entPhysicalAssetID")
  • $entity->e_map() β€” see MIB, bestie. It's all in there. ("entAliasMappingIdentifier")
  • $entity->e_model() β€” the model name of the entity. Name her! πŸ‘‘ ("entPhysicalModelName")
  • $entity->e_name() β€” the more computer-friendly name of the entity. Parse me. ✨ ("entPhysicalName")
  • $entity->e_parent() β€” 0 if it's a root. Roots only. 🌱 ("entPhysicalContainedIn")
  • $entity->e_port() β€” maps Entity Table entries over to the Interface Table ("IfTable") by using $entity->e_map(). Matchmaker matchmaker. πŸ’˜
  • $entity->e_pos() β€” the relative position among all entities that share the same parent. Sibling ranking, honestly. ("entPhysicalParentRelPos")
  • $entity->e_serial() β€” the serial number. The main character. ⭐ ("entPhysicalSerialNum")
  • $entity->e_swver() β€” the software revision. ("entPhysicalSoftwareRev")
  • $entity->e_type() β€” this is an OID, which gets munged into the object name if the right MIB is loaded. Loaded MIB = glow up. 🌈 ("entPhysicalVendorType")
  • $entity->e_vendor() β€” vendor of the module. Who made her. 🏭 ("entPhysicalMfgName")

okay that's the whole page bestie, every flag, every OID, every last crumb, we ate and left no crumbs πŸ’…βœ¨

this lil doc came from perl v5.40.1 and it's dated 2026-02-28 β€” so when you're reading this from the future, know that it's still the SNMP::...Entity(3pm) page, still iconic, still here. πŸ¦‹πŸ’– periodt.

πŸ“¦ where this page comes from