Switches, Hubs, and Modems
cancel
Showing results for 
Search instead for 
Did you mean: 

SNMP Accessing LLDP

SOLVED
Go to solution

SNMP Accessing LLDP

Is it possible to get the LLDP information from a switch (in particular the lldp info remote-device) using SNMP? Does anyone know the OID?

Thank-you
9 REPLIES
Mohieddin Kharnoub
Honored Contributor

Re: SNMP Accessing LLDP

Hi Peter
For LLDP information it is stored in the SNMP MIB and it is valid for a period of time defined by the LLDP "Time to Live" (TTL) value that is contained within the received packet.
ProCurve switches has also LLDP-MED, and for both you can get the information, download the MIBs for Procurve : http://www.hp.com/rnd/software/MIBs.htm
and look after file contains 802.lab.

Good luck
Science for Everyone
Matt Hobbs
Honored Contributor
Solution

Re: SNMP Accessing LLDP

I can find most of what's contained in 'show lldp remote-device' except for the local port entry:

sw11975# walkmib 1.0.8802.1.1.2.1.4.1.1.5
lldpRemChassisId.0.1.1 = mrn01sw002-L1(000d9d-c17280)
lldpRemChassisId.0.3.1 = 00 11 85 a8 00 00

sw11975# walkmib 1.0.8802.1.1.2.1.4.1.1.7
lldpRemPortId.0.1.1 = 43
lldpRemPortId.0.3.1 = 1

sw11975# walkmib 1.0.8802.1.1.2.1.4.1.1.8
lldpRemPortDesc.0.1.1 =
lldpRemPortDesc.0.3.1 = 1

sw11975# walkmib 1.0.8802.1.1.2.1.4.1.1.9
lldpRemSysName.0.1.1 =
lldpRemSysName.0.3.1 = matt-1

I believe that the 802.3AB LLDP-MIB is not yet in the ProCurve MIBs mentioned above.

You can download the LLDP MIBs from:

http://www.ieee802.org/1/files/public/MIBs
Robert Thompson (SWAU)
Occasional Visitor

Re: SNMP Accessing LLDP

If you back up to the LLDP root, you can even get most of the local-port information:

getmib 1.0.8802.1.1.2


Also, if it's not obvious, the local port id is used both to index the local port info and the remote peer info discovered through that port.

A quick glance shows it also matches the index for the IF-MIB, although that will not be true if LLDPPortIDType isn't ifIndexType ...

Walther Lehmann
Occasional Visitor

Re: SNMP Accessing LLDP

Sorry for resurrect this old thread, but I have a follow up question concerning the same topic.

I try to get some information from the LLDP MIB. I was able to find out the OIDs for the information i was looking for. But I was not able to receive the date until I found this thread.
From the MIB definition the OID for lldpRemSysName is 1.0.8802.1.1.2.1.4.1.1.9 but to really get the name I have to send 1.0.8802.1.1.2.1.4.1.1.9.0.1.1
So my first question is: Where do I find information about these additional numbers to get the value of a specific variable?
To be more specific, I'm looking for the lldpRemManAddr value. I know the OID for this is 1.0.8802.1.1.2.1.4.2.1.2, but I do only get a null response back. So how do I get this value?

Thank you
joehenderson
Occasional Advisor

Re: SNMP Accessing LLDP

I use the following in perl for the remote management ip of a device. OID: ".1.3.6.1.4.1.9.9.23.1.2.1.1.4"

This gives you the HEX == of the ip. you will need to convert to numeric..

if(((length($val)) == 10) && ($val =~ /^\0\x/))
{
$val = substr($val, 2, 8); # remove 1st 2 variables
}

$key = undef;
foreach $key ($val =~ /[a-f0-9]{2}/g)
{
if($debug == 1) { print "KEY: \"$key\"\n"; }
$val = undef;
$val = hex($key);
if($debug == 1) { print "VAL: \"$val\"\n"; }
$fip .= $val . ".";
if($debug == 1) { print "IP: \"$fip\"\n"; }
}
Hemul
Regular Advisor

Re: SNMP Accessing LLDP

Hello, You use CDP this is not LLDP.
davidrickard
Occasional Visitor

Re: SNMP Accessing LLDP

I am confused by this thread, I have the latest MIBs downloaded and compiled> I have even searched the text files of the MIBs and the OIDs listed in this thread don't exist in the HP MIBs. I suspect the MIBs have been changed or maybe the LLDP one ommitted from the zip file?

Has anyone got any ideas?
Javed Padinhakara
Respected Contributor

Re: SNMP Accessing LLDP

@david...

You can get the LLDP mib's from http://www.ieee802.org/1/files/public/MIBs/.



@Walther
IF you notice lldpRemManAddr belongs to the lldpRemManAddrTable table and this has the indicies specified as
1: lldpRemTimeMark
2: lldpRemLocalPortNum
3: lldpRemIndex
4: lldpRemManAddrSubtype
5: lldpRemManAddr

So one way would be do a walk of lldpRemTable and lldpRemManAddrOID to extract the indicies and then figure out the lldpRemManAddr

HTH
Javed
davidrickard
Occasional Visitor

Re: SNMP Accessing LLDP

Thanks Javed, exactly what I needed.