-
Notifications
You must be signed in to change notification settings - Fork 599
NMS-18059: Fix LLDP handling for SNMP agents from Planet and Microsense #7776
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
Conversation
Therad.sleep from 1000 to 20 ms
The data collection fails for errors Also fixed mac addresses with dash instead of other separator
Speeded up tests
Added more matchable criteria for topology link Micro sense Lldp snmp data present wrong informatiopn on lldptable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rssntn67 Can you update description on what you are trying to fix in this PR.
I see some common utils getting refactoring to LldpSnmpUtils. Other than that what else is important to review here ?
Also we require a JIRA issue for this contribution. Let me know if you need any help here.
I appreciate this contribution @rssntn67! I really appreciate the work on the "formatMacAddress" function. Will be good to see that working. Let us know if you need any help with the items @cgorantla mentioned. |
I have updated the informations. It is a work I've done a coule of months ago. I guess it is all. |
Done |
@rssntn67, how are the MAC addresses stored in the database? Is it as collected from the devices or are they decoded and sanitized before storing? |
Well, they are decoded ad sanitized and the final format is "001122334455", but on the other end if the sanitation does not work I store the string. In the case of planet the data was formatted as a string: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a few minor things to change...
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
...vice/impl/src/main/java/org/opennms/netmgt/enlinkd/service/impl/LldpTopologyServiceImpl.java
Outdated
Show resolved
Hide resolved
...vice/impl/src/main/java/org/opennms/netmgt/enlinkd/service/impl/LldpTopologyServiceImpl.java
Outdated
Show resolved
Hide resolved
...vice/impl/src/main/java/org/opennms/netmgt/enlinkd/service/impl/LldpTopologyServiceImpl.java
Outdated
Show resolved
Hide resolved
...vice/impl/src/main/java/org/opennms/netmgt/enlinkd/service/impl/LldpTopologyServiceImpl.java
Outdated
Show resolved
Hide resolved
...vice/impl/src/main/java/org/opennms/netmgt/enlinkd/service/impl/LldpTopologyServiceImpl.java
Outdated
Show resolved
Hide resolved
…ennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java Co-authored-by: Christian Pape <[email protected]>
…ennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java Co-authored-by: Christian Pape <[email protected]>
…ennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java Co-authored-by: Christian Pape <[email protected]>
…ennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java Co-authored-by: Christian Pape <[email protected]>
…ennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java Co-authored-by: Christian Pape <[email protected]>
…/enlinkd/service/impl/LldpTopologyServiceImpl.java Co-authored-by: Christian Pape <[email protected]>
…/enlinkd/service/impl/LldpTopologyServiceImpl.java Co-authored-by: Christian Pape <[email protected]>
…/enlinkd/service/impl/LldpTopologyServiceImpl.java Co-authored-by: Christian Pape <[email protected]>
…/enlinkd/service/impl/LldpTopologyServiceImpl.java Co-authored-by: Christian Pape <[email protected]>
…/enlinkd/service/impl/LldpTopologyServiceImpl.java Co-authored-by: Christian Pape <[email protected]>
…/enlinkd/service/impl/LldpTopologyServiceImpl.java Co-authored-by: Christian Pape <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
|
||
public static String getInterface(SnmpValue snmpValue) { | ||
if (snmpValue == null ) | ||
return "Null"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this custom null ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is simply a way of returning the value in the database.
It looks better in UI.
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Show resolved
Hide resolved
} catch (Exception e) { | ||
LOG.debug("getNetworkAddress: not valid {}", snmpValue.toDisplayString()); | ||
} | ||
return "Not Valid"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to throw exception instead of custom return values or use Optional ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is simply a way of returning the value in the database.
It looks better in UI.
If I throw the exception then I have to forgot the data.
Too many weird Snmp implementation of Lldp.
The most important is having data saved.
...kd/adapters/collectors/lldp/src/main/java/org/opennms/netmgt/enlinkd/snmp/LldpSnmpUtils.java
Outdated
Show resolved
Hide resolved
features/enlinkd/tests/src/test/java/org/opennms/netmgt/enlinkd/Nms10205bEnIT.java
Show resolved
Hide resolved
Use brackets for if Let reg expression be constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks for your contribution.
This PR regards an issue related to couple of devices supporting lldp MIB.
The devices are Microsense and Planet.
In particular Planet reports mac addresses using the - So mac address 00:00:00:00:00:00 is reported ad 00-00-00-00-00-00.
So first of all I moved all the methods to decode from snmp agent into SnmpLldpUtils class. I guess that is a better place, before where in the tracker classes. Because of weird snmp agent implementation I have moved all the stuff converting snmp data into proper string in one place.
The Microsense also has wrong decoding of the LLDP mib and data needs to be properly decoded. Inparticular Hex Strings are coded as Strings.
finally I have reworked the LldpServiceImpl this class is fundamental to produce topology used in topology maps. I have reworked the class to let find links in more ways. Also to support Microsense to Microsense Lldp links beceuase I found that there is a bug in the lldp oimplementation reporting the wrong port on sides.
I ave run all the IT test of enlinkd and everything is fine.
Also I changed some Thread.sleep statements from 1000ms to 200ms to speed up test running
https://opennms.atlassian.net/browse/NMS-18059