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()β0if 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
- ubuntu stonking: libsnmp-info-perl 3.975000-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms