SNMP::Info::LLDP(3pm)
π SNMP::Info::LLDP π
okay bestie, so this is SNMP::Info::LLDP β it's part of the User Contributed Perl Documentation situation (a 3pm page, iykyk), and it's literally the SNMP interface to the Link Layer Discovery Protocol, aka LLDP β¨
Written by Eric Miller. Give them their flowers π
π SYNOPSIS π
my $lldp = new SNMP::Info (
AutoSpecify => 1,
Debug => 1,
DestHost => 'router',
Community => 'public',
Version => 2
);
my $class = $lldp->class();
print " Using device sub class : $class\n";
$haslldp = $lldp->hasLLDP() ? 'yes' : 'no';
# Print out a map of device ports with LLDP neighbors:
my $interfaces = $lldp->interfaces();
my $lldp_if = $lldp->lldp_if();
my $lldp_ip = $lldp->lldp_ip();
my $lldp_port = $lldp->lldp_port();
foreach my $lldp_key (keys %$lldp_ip){
my $iid = $lldp_if->{$lldp_key};
my $port = $interfaces->{$iid};
my $neighbor = $lldp_ip->{$lldp_key};
my $neighbor_port = $lldp_port->{$lldp_key};
print "Port : $port connected to $neighbor / $neighbor_port\n";
}
β¨ DESCRIPTION β¨
SNMP::Info::LLDP is a subclass of SNMP::Info that hands you a whole object oriented interface to LLDP info through SNMP. no cap π«Ά
LLDP is a Layer 2 protocol that lets a network device advertise its identity and capabilities on the local network, which gives you topology info. The protocol is defined in the IEEE standard 802.1AB. iconic behavior honestly.
Create or use a device subclass that inherits this class. Do not use directly. fr fr. π
𧬠Inherited Classes
None. that's it, that's the list π
π Required MIBs
LLDP-MIBLLDP-EXT-MED-MIBLLDP-EXT-DOT1-MIBLLDP-EXT-DOT3-MIB
π GLOBALS π
these are methods that return scalar values from SNMP πΈ
$lldp->hasLLDP()β is LLDP actually active in this device?
Note: LLDP may be active, but nothing in lldpRemoteSystemsData Tables so the device would not return any useful topology information. so likeβ¦ it's awake but it's not giving anything π
$lldp->lldp_sysname()β the string value used to identify the system name of the local system. If the local agent supports IETF RFC 3418,lldpLocSysNameobject should have the same value ofsysNameobject.
Nulls are removed before the value is returned.
(lldpLocSysName)
$lldp->lldp_sysdesc()β the string value used to identify the system description of the local system. If the local agent supports IETF RFC 3418,lldpLocSysDescobject should have the same value ofsysDescobject.
Nulls are removed before the value is returned.
(lldpLocSysDesc)
$lldp->lldp_sys_cap()β returns which system capabilities are enabled on the local system. Results are munged into an ascii binary string, LSB. Each digit represents a bit from the table below:- Bit
other(0)indicates that the system has capabilities other than those listed below. - Bit
repeater(1)indicates that the system has repeater capability. - Bit
bridge(2)indicates that the system has bridge capability. - Bit
wlanAccessPoint(3)indicates that the system has WLAN access point capability. - Bit
router(4)indicates that the system has router capability. - Bit
telephone(5)indicates that the system has telephone capability. - Bit
docsisCableDevice(6)indicates that the system has DOCSIS Cable Device capability (IETF RFC 2669 & 2670). - Bit
stationOnly(7)indicates that the system has only station capability and nothing else."
- Bit
(lldpLocSysCapEnabled)
$lldp->lldp_loc_id()β the string value used to identify the chassis component associated with the local system.
(lldpLocChassisId)
$lldp->lldp_loc_id_type()β the type of encoding used to identify the chassis associated with the local system.
This is used by the above method to decode the octet string in lldpLocChassisId
(lldpLocChassisIdSubtype)
π¦ TABLE METHODS π¦
these ones return tables of info as a reference to a hash. group chat energy but make it data structures π
$lldp->lldp_id()β returns the string value used to identify the chassis component associated with the remote system.
(lldpRemChassisId)
$lldp->lldp_if()β returns the mapping to the SNMP Interface Table. Tries to cross reference (lldpLocPortDesc) with (ifDescr) and (ifAlias) to get (ifIndex), if unable defaults to (lldpRemLocalPortNum). it's doing its best okay π₯Ί$lldp->lldp_ip()β returns remote IPv4 address. Returns for all other address types, use lldp_addr if you want any return address type.$lldp->lldp_ipv6()β returns remote IPv6 address, if known. Returns for all other address types, use lldp_addr if you don't care about return address type.$lldp->lldp_mac()β returns remote (management) MAC address, if known. Returns for all other address types, use lldp_addr if you don't care about return address type.$lldp->lldp_addr()β returns remote address. Type may be any IANA Address Family Number. Currently only returns IPv4, IPv6 or MAC addresses. If the remote device returns more than one address type, this method will give only one. Which one is returned is decided by chance, phase of the moon and Perl hash ordering. π not me getting my networking data from astrology
Use lldp_mac, lldp_ip or lldp_ipv6 if you want a specific address type.
$lldp->lldp_port()β returns remote port ID$lldp->lldp_platform()β tries to return something useful fromlldp_rem_sysdesc()orlldp_rem_sysname(). bestie it is trying π«Ά$lldp->lldp_cap()β returns hash of arrays with each array containing the system capabilities supported by the remote system. Possible elements in the array are enumerated fromLldpSystemCapabilitiesMap.$lldp->lldp_media_cap()β returns hash of arrays with each array containing the media capabilities supported by the remote system. Possible elements in the array are enumerated fromLldpXMedCapabilities.
π‘ LLDP Remote Table (lldpRemTable)
$lldp->lldp_rem_id_type()β returns the type of encoding used to identify the chassis associated with the remote system.
(lldpRemChassisIdSubtype)
$lldp->lldp_rem_id()β returns the string value used to identify the chassis component associated with the remote system.
(lldpRemChassisId)
$lldp->lldp_rem_pid_type()β returns the type of port identifier encoding used in the associatedlldpRemPortIdobject.
(lldpRemPortIdSubtype)
$lldp->lldp_rem_pid()β returns the string value used to identify the port component associated with the remote system.
(lldpRemPortId)
$lldp->lldp_rem_desc()β returns the string value used to identify the description of the given port associated with the remote system.
Nulls are removed before the value is returned.
(lldpRemPortDesc)
$lldp->lldp_rem_sysname()β returns the string value used to identify the system name of the remote system.
Nulls are removed before the value is returned.
(lldpRemSysName)
$lldp->lldp_rem_sysdesc()β returns the string value used to identify the system description of the remote system.
Nulls are removed before the value is returned.
(lldpRemSysDesc)
$lldp->lldp_rem_hw_rev()β returns the string value used to identify the hardware revision of the remote system. Nulls are removed before the value is returned.
(lldpXMedRemHardwareRev)
$lldp->lldp_rem_fw_rev()β returns the string value used to identify the firmware revision of the remote system. Nulls are removed before the value is returned.
(lldpXMedRemHardwareRev)
$lldp->lldp_rem_sw_rev()β returns the string value used to identify the software revision of the remote system. Nulls are removed before the value is returned.
(lldpXMedRemSoftwareRev)
$lldp->lldp_rem_serial()β returns the string value used to identify the serial number of the remote system. Nulls are removed before the value is returned.
(lldpXMedRemSerialNum)
$lldp->lldp_rem_vendor()β returns the string value used to identify the manufacturer of the remote system. Nulls are removed before the value is returned.
(lldpXMedRemMfgName)
$lldp->lldp_rem_asset()β returns the string value used to identify the asset number of the remote system. Nulls are removed before the value is returned.
(lldpXMedRemAssetID)
$lldp->lldp_rem_model()β returns the string value used to identify the model of the remote system. Nulls are removed before the value is returned.
(lldpXMedRemModelName)
$lldp->lldp_rem_media_cap_spt()β returns which media capabilities are supported on the remote system. Results are munged into an ascii binary string, LSB.$lldp->lldp_rem_media_cap()β returns which media capabilities are enabled on the remote system. Results are munged into an ascii binary string, LSB.$lldp->lldp_rem_sys_cap()β returns which system capabilities are enabled on the remote system. Results are munged into an ascii binary string, LSB. Each digit represents a bit from the table below:- Bit
other(0)indicates that the system has capabilities other than those listed below. - Bit
repeater(1)indicates that the system has repeater capability. - Bit
bridge(2)indicates that the system has bridge capability. - Bit
wlanAccessPoint(3)indicates that the system has WLAN access point capability. - Bit
router(4)indicates that the system has router capability. - Bit
telephone(5)indicates that the system has telephone capability. - Bit
docsisCableDevice(6)indicates that the system has DOCSIS Cable Device capability (IETF RFC 2669 & 2670). - Bit
stationOnly(7)indicates that the system has only station capability and nothing else."
- Bit
(lldpRemSysCapEnabled)
and that's the whole page bestie, you ate π β¨
cute little sign-off: this was perl v5.40.1, dated 2026-02-28, and it's the SNMP::Info::LLDP(3pm) page. go map some topology, you've got this ππ¦π
π¦ 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