New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lldp discovery change local port resolution #7443

Merged
merged 3 commits into from Oct 24, 2017

Conversation

Projects
None yet
5 participants
@murrant
Member

murrant commented Oct 6, 2017

dot1dBasePortIfIndex seems to skip some ports in certain configurations on Cisco devices, use lldpLocPortId instead.
Add quirk for Calix devices that return different port labels than they actually are.
This needs to be tested.

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

fixes: #7370

fix: lldp discovery change local port resolution
dot1dBasePortIfIndex seems to skip some ports in certain configurations on Cisco devices.
Add quirk for Calix devices that return different port labels than they actually are.
@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Oct 6, 2017

Member

Can you include this fix #7370?

Member

laf commented Oct 6, 2017

Can you include this fix #7370?

@murrant murrant added this to the 1.33 milestone Oct 16, 2017

@kkrumm1

This comment has been minimized.

Show comment
Hide comment
@kkrumm1

kkrumm1 Oct 17, 2017

Member

I can run a test on this but I don't have any cisco or Calix devices... just HP.
Would the testing still be valid? @murrant

Member

kkrumm1 commented Oct 17, 2017

I can run a test on this but I don't have any cisco or Calix devices... just HP.
Would the testing still be valid? @murrant

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Oct 17, 2017

Member

@kkrumm1 definitely

Member

murrant commented Oct 17, 2017

@kkrumm1 definitely

@kkrumm1

This comment has been minimized.

Show comment
Hide comment
@kkrumm1

kkrumm1 Oct 19, 2017

Member

testing

Member

kkrumm1 commented Oct 19, 2017

testing

@kkrumm1

This comment has been minimized.

Show comment
Hide comment
@kkrumm1

kkrumm1 Oct 19, 2017

Member

not seeing any issues so far at work.

Member

kkrumm1 commented Oct 19, 2017

not seeing any issues so far at work.

@murrant murrant removed the Needs Testing label Oct 20, 2017

@khobbits

This comment has been minimized.

Show comment
Hide comment
@khobbits

khobbits Oct 23, 2017

Contributor

I've been running this for almost 3 days, I've noticed additional links appearing, and things seem to be overall a bit better.

I did however find a few links that are no longer visible...

Before patch:

SNMP[�[0;36m/usr/bin/snmpbulkwalk -v2c -c COMMUNITY -OQUsetX -m BRIDGE-MIB -M /opt/librenms/mibs udp:HOSTNAME:161 dot1dBasePortIfIndex�[0m]
dot1dBasePortIfIndex[1] = 1001
dot1dBasePortIfIndex[2] = 1002

After patch:

SNMP[�[0;36m/usr/bin/snmpbulkwalk -v2c -c COMMUNITY -OQUsetX -m LLDP-MIB -M /opt/librenms/mibs udp:HOSTNAME:161 lldpLocPortId�[0m]
lldpLocPortId[1] = "1"
lldpLocPortId[2] = "2"

This means the matching query is:

Before:

SELECT * FROM `ports` WHERE `device_id` = '2' AND `ifIndex` = '1001'
Results 1

After:

SELECT `port_id` FROM `ports` WHERE (0 OR `ifDescr`='1' OR `ifName`='1' OR `ifAlias`='1' OR `ifIndex`='1') AND `device_id`='2'
Results 0

Table:

mysql> select ifDescr,ifName,ifAlias,ifIndex from `ports` WHERE `device_id`='2' limit 2;
+-----------------------+--------+-----------------------+---------+
| ifDescr               | ifName | ifAlias               | ifIndex |
+-----------------------+--------+-----------------------+---------+
| X650-24x(SSns) Port 1 | 1:1    | X650-24x(SSns) Port 1 |    1001 |
| X650-24x(SSns) Port 2 | 1:2    | X650-24x(SSns) Port 2 |    1002 |
Contributor

khobbits commented Oct 23, 2017

I've been running this for almost 3 days, I've noticed additional links appearing, and things seem to be overall a bit better.

I did however find a few links that are no longer visible...

Before patch:

SNMP[�[0;36m/usr/bin/snmpbulkwalk -v2c -c COMMUNITY -OQUsetX -m BRIDGE-MIB -M /opt/librenms/mibs udp:HOSTNAME:161 dot1dBasePortIfIndex�[0m]
dot1dBasePortIfIndex[1] = 1001
dot1dBasePortIfIndex[2] = 1002

After patch:

SNMP[�[0;36m/usr/bin/snmpbulkwalk -v2c -c COMMUNITY -OQUsetX -m LLDP-MIB -M /opt/librenms/mibs udp:HOSTNAME:161 lldpLocPortId�[0m]
lldpLocPortId[1] = "1"
lldpLocPortId[2] = "2"

This means the matching query is:

Before:

SELECT * FROM `ports` WHERE `device_id` = '2' AND `ifIndex` = '1001'
Results 1

After:

SELECT `port_id` FROM `ports` WHERE (0 OR `ifDescr`='1' OR `ifName`='1' OR `ifAlias`='1' OR `ifIndex`='1') AND `device_id`='2'
Results 0

Table:

mysql> select ifDescr,ifName,ifAlias,ifIndex from `ports` WHERE `device_id`='2' limit 2;
+-----------------------+--------+-----------------------+---------+
| ifDescr               | ifName | ifAlias               | ifIndex |
+-----------------------+--------+-----------------------+---------+
| X650-24x(SSns) Port 1 | 1:1    | X650-24x(SSns) Port 1 |    1001 |
| X650-24x(SSns) Port 2 | 1:2    | X650-24x(SSns) Port 2 |    1002 |
@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Oct 23, 2017

Member

Thanks for the great feedback @khobbits . I'll see if I can fix that up.

Member

murrant commented Oct 23, 2017

Thanks for the great feedback @khobbits . I'll see if I can fix that up.

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Oct 23, 2017

The inspection completed: 2 new issues

scrutinizer-notifier commented Oct 23, 2017

The inspection completed: 2 new issues

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Oct 24, 2017

Member

@khobbits reported this working on Discord.

Member

murrant commented Oct 24, 2017

@khobbits reported this working on Discord.

@laf laf merged commit f01cf38 into librenms:master Oct 24, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant deleted the murrant:lldp-local-port branch Nov 21, 2017

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018

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