Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

petertavenier
Copy link

this change is described in issue #18317

I'm not sure test data can show this since this is specific for a hardware device. so not checked those boxes. Hope the issue explains it, otherwise I'll try to explain better.

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2025

CLA assistant check
All committers have signed the CLA.

@ottorei
Copy link
Contributor

ottorei commented Oct 8, 2025

Testing this on my setup at the moment and so far so good... Some messed up data seems to be fixed now on newer software versions.

@laf
Copy link
Member

laf commented Oct 10, 2025

In your issue you say "When running this on a Juniper EX3300 (at least seen on this types) the neighbor info is incorrect most of the time."

What causes it to be incorrect most, but not all of the time?

@ottorei
Copy link
Contributor

ottorei commented Oct 11, 2025

The device outputs neighbors as ifindex

@laf
Copy link
Member

laf commented Oct 11, 2025

I get that but you make it sound like it doesn't happen all the time.

@ottorei
Copy link
Contributor

ottorei commented Oct 13, 2025

I get that but you make it sound like it doesn't happen all the time.

Some ports had the correct data while others did not. There must be something wrong with the check

} elseif (isset($dot1d_array) && isset($dot1d_array[$entry_key]) && is_numeric($dot1d_array[$entry_key]['dot1dBasePortIfIndex'])) { $ifIndex = $dot1d_array[$entry_key]['dot1dBasePortIfIndex']; }

... as the default is to use the array key as ifindex as explicitly done with junos on this commit, which makes me think this is related to #18145

@petertavenier
Copy link
Author

I'm not sure, but I think this is because the statement;

        } elseif (isset($dot1d_array) && isset($dot1d_array[$entry_key]) && is_numeric($dot1d_array[$entry_key]['dot1dBasePortIfIndex'])) {
            $ifIndex = $dot1d_array[$entry_key]['dot1dBasePortIfIndex'];

is just before

        } else {
            $ifIndex = $entry_key;

and maybe not in all cases the elseif is AND statements are all matched and therefor the $ifIndex = $entry_key is also used as in the latest else statement.

An example of data is shown below.

If I add the two lines so $ifIndex = $entry_key is used the LLDP info for this port is correct. otherwise the LLDP info shows local port ge-0/0/27 (which is even down) for the LLDP neighbor.

SNMP[�[0;36m'/usr/bin/snmpbulkwalk' '-Cr10' '-v2c' '-c' 'COMMUNITY' '-OQUs' '-m' 'IF-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/junos' '-t' '10' '-r' '2' 'udp:HOSTNAME:161' 'ifDescr'�[0m]

ifDescr.517 = mge-0/0/1
ifDescr.543 = ge-0/0/27
ifDescr.552 = mge-0/0/1.0
ifDescr.591 = ge-0/0/27.0
SNMP[�[0;36m'/usr/bin/snmpbulkwalk' '-Cr10' '-v2c' '-c' 'COMMUNITY' '-OQUs' '-m' 'IF-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/junos' '-t' '10' '-r' '2' 'udp:HOSTNAME:161' 'ifName'�[0m]

ifName.517 = mge-0/0/1
ifName.543 = ge-0/0/27
ifName.552 = mge-0/0/1.0
ifName.591 = ge-0/0/27.0


SNMP[�[0;36m'/usr/bin/snmpbulkwalk' '-Cr10' '-v2c' '-c' 'COMMUNITY' '-OQUs' '-m' 'IF-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/junos' '-t' '10' '-r' '2' 'udp:HOSTNAME:161' 'ifOperStatus'�[0m]

ifOperStatus.517 = up
ifOperStatus.543 = down
ifOperStatus.552 = up
ifOperStatus.591 = lowerLayerDown

  517 => 
  array (
    'ifDescr' => 'mge-0/0/1',
    'ifName' => 'mge-0/0/1',
    'ifAlias' => 'description of the interface is removed for privacy reasons',
    'ifType' => 'ethernetCsmacd',
    'ifOperStatus' => 'up',
  ),
  543 => 
  array (
    'ifDescr' => 'ge-0/0/27',
    'ifName' => 'ge-0/0/27',
    'ifAlias' => '',
    'ifType' => 'ethernetCsmacd',
    'ifOperStatus' => 'down',
  ),
  552 => 
  array (
    'ifDescr' => 'mge-0/0/1.0',
    'ifName' => 'mge-0/0/1.0',
    'ifAlias' => '',
    'ifType' => 'propVirtual',
    'ifOperStatus' => 'up',
  ),
  591 => 
  array (
    'ifDescr' => 'ge-0/0/27.0',
    'ifName' => 'ge-0/0/27.0',
    'ifAlias' => '',
    'ifType' => 'propVirtual',
    'ifOperStatus' => 'lowerLayerDown',
  ),


SNMP[�[0;36m'/usr/bin/snmpbulkwalk' '-Cr10' '-v2c' '-c' 'COMMUNITY' '-OQUsetX' '-m' 'BRIDGE-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/junos' '-t' '10' '-r' '2' 'udp:HOSTNAME:161' 'dot1dBasePortIfIndex'�[0m]

dot1dBasePortIfIndex[517] = 543


@ottorei
Copy link
Contributor

ottorei commented Oct 13, 2025

Is this on a newer software and hardware?

@petertavenier
Copy link
Author

Is this on a newer software and hardware?

Yes, the specific output in #18318 (comment) is from and EX4100-48MP running 22.4R3-S4.4

SNMP['/usr/bin/snmpget' '-v2c' '-c' 'COMMUNITY' '-OQUs' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/junos' '-t' '10' '-r' '2' 'udp:HOSTNAME:161' 'JUNIPER-MIB::jnxBoxDescr.0' 'JUNIPER-MIB::jnxBoxSerialNo.0' 'JUNIPER-VIRTUALCHASSIS-MIB::jnxVirtualChassisMemberSWVersion.0' 'HOST-RESOURCES-MIB::hrSWInstalledName.1' 'HOST-RESOURCES-MIB::hrSWInstalledName.2']

jnxBoxDescr.0 = Juniper EX4100-48MP Switch
jnxBoxSerialNo.0 = <removed>
jnxVirtualChassisMemberSWVersion.0 = 22.4R3-S4.4
hrSWInstalledName.1 = No Such Instance currently exists at this OID
hrSWInstalledName.2 = "JUNOS Base OS Software Suite [22.4R3-S4.4]"  

@murrant
Copy link
Member

murrant commented Oct 13, 2025

Here's the deal. LLDP supports different TLV. The code tries to guess what TLV is available by first checking if the 802.1D index is used. Then it should fallback to ifIndex. (there are signs that check is faulty)

These things are sometimes user-configurable and some are determined by the neighbor device. So setting it per-os is usually folly. There are SNMP OIDs to detect which TLV are used, but they are often inconsistent.

Over all, the LLDP code is just a mess and devolving rapidly. Hopefully, I can get some time to push @Npeca75 's rework of it across the finish line.

In summary, you can't just assume it is ifIndex for all JunOS.

@ottorei
Copy link
Contributor

ottorei commented Oct 14, 2025

Is this on a newer software and hardware?

Yes, the specific output in #18318 (comment) is from and EX4100-48MP running 22.4R3-S4.4

SNMP['/usr/bin/snmpget' '-v2c' '-c' 'COMMUNITY' '-OQUs' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/junos' '-t' '10' '-r' '2' 'udp:HOSTNAME:161' 'JUNIPER-MIB::jnxBoxDescr.0' 'JUNIPER-MIB::jnxBoxSerialNo.0' 'JUNIPER-VIRTUALCHASSIS-MIB::jnxVirtualChassisMemberSWVersion.0' 'HOST-RESOURCES-MIB::hrSWInstalledName.1' 'HOST-RESOURCES-MIB::hrSWInstalledName.2']

jnxBoxDescr.0 = Juniper EX4100-48MP Switch
jnxBoxSerialNo.0 = <removed>
jnxVirtualChassisMemberSWVersion.0 = 22.4R3-S4.4
hrSWInstalledName.1 = No Such Instance currently exists at this OID
hrSWInstalledName.2 = "JUNOS Base OS Software Suite [22.4R3-S4.4]"  

Thanks. This explains why I never saw this on older devices like EX2200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.