Unable to see Telnet/HTTP/OpenManage links in node.jsp
Description
Since upgrade to 1.8.5 (or 1.8.6, forgot) links are not shown for Telnet/HTTP/OpenManage in node.jsp, even when appropriate services were actually discovered.
Went to debug element/node.jsp. In findServiceAddress(), a "List<InetAddress> ips" contains the correct list of IPv4 addresses for the node+service. But getLowestInetAddress(ips) seems to always return null instead of an address, so the service is not advertised later on.
A workaround for me was to bypass getLowestInetAddress() altogether and for now use the first available IP as in the patch below, as I don't (yet) understand how getLowestInetAddress() or ByteArrayComparator works.
if (lowest != null) { return lowest.getHostAddress();
Environment
CentOS 5.5 x86_64, Sun Java 1.6.0_23, OpenNMS YUM/RPM install; verified on clean install
Acceptance / Success Criteria
None
Lucidchart Diagrams
Activity
Show:
Seth Leger February 14, 2011 at 11:23 AM
Thanks for going into the code and tracking down which line was causing the problem! This definitely made the problem easier to track down. I'll close this bug since you've verified correct behavior.
Martin Lorentz (SAML-Reparatur-Account) February 14, 2011 at 7:15 AM
Backported the fix in getLowestInetAddress() to 1.8.9, works fine for me. Thanks!
Seth Leger February 10, 2011 at 3:00 PM
This comparison function is now fixed in 1.8 and master (1.9), marking as fixed.
commit 8305a0fce06606b61732bdefd6255e483ca4c5ed
Seth Leger February 10, 2011 at 11:07 AM
I am looking at this now. This was a bug that was introduced during my changes to InetAddressUtils when I was adding IPv6 capabilities to this class. I should have a fix pretty soon.
David Hustace February 10, 2011 at 8:40 AM
Seth, have you looked at this one? I think we should move the link to the interface page for the interfaces that actually have the service rather than the node page.
Since upgrade to 1.8.5 (or 1.8.6, forgot) links are not shown for Telnet/HTTP/OpenManage in node.jsp, even when appropriate services were actually discovered.
Went to debug element/node.jsp. In findServiceAddress(), a "List<InetAddress> ips" contains the correct list of IPv4 addresses for the node+service. But getLowestInetAddress(ips) seems to always return null instead of an address, so the service is not advertised later on.
A workaround for me was to bypass getLowestInetAddress() altogether and for now use the first available IP as in the patch below, as I don't (yet) understand how getLowestInetAddress() or ByteArrayComparator works.
— node.jsp.orig 2011-02-09 03:06:38.000000000 +0100
+++ node.jsp 2011-02-09 21:43:46.000000000 +0100
@@ -130,7 +130,7 @@
ips.add(InetAddress.getByName(service.getIpAddress()));
}
InetAddress lowest = InetAddressUtils.getLowestInetAddress(ips);
+ InetAddress lowest = ips.get(0);
if (lowest != null) {
return lowest.getHostAddress();