linkd not working

Description

1. i tried different versions including the latest 1.8.1-SNAPSHOT-12072010
2. enabled linkd function inside "service-configuration.xml"
<service>
<name>OpenNMS:Name=Linkd</name>
<class-name>org.opennms.netmgt.linkd.jmx.Linkd</class-name>
<invoke at="start" pass="0" method="init"/>
<invoke at="start" pass="1" method="start"/>
<invoke at="status" pass="0" method="status"/>
<invoke at="stop" pass="0" method="stop"/>
</service>

3. link.log only reports UPDATE queries, no INSERTS

2010-07-13 12:34:29,466 DEBUG [LinkdScheduler-5 Pool-fiber1] DbAtInterfaceEntry: AtInterfaceEntry.update: SQL insert statment = UPDATE AtInterface SET sourcenodeid = ?,lastpolltime = ? WHERE nodeid = ? AND ipaddr = ?
2010-07-13 12:34:29,503 DEBUG [LinkdScheduler-5 Pool-fiber1] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:29,515 DEBUG [LinkdScheduler-5 Pool-fiber1] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:29,533 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE atinterface set status = 'N' WHERE sourcenodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=47.
2010-07-13 12:34:29,534 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE vlan set status = 'N' WHERE nodeid =? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=47.
2010-07-13 12:34:29,538 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE iprouteinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=47.
2010-07-13 12:34:29,539 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE stpnode set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=47.
2010-07-13 12:34:29,539 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE stpinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=47.
2010-07-13 12:34:29,717 DEBUG [LinkdScheduler-5 Pool-fiber0] DbAtInterfaceEntry: AtInterfaceEntry.update: SQL insert statment = UPDATE AtInterface SET sourcenodeid = ?,lastpolltime = ? WHERE nodeid = ? AND ipaddr = ?
2010-07-13 12:34:29,725 DEBUG [LinkdScheduler-5 Pool-fiber0] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:29,729 DEBUG [LinkdScheduler-5 Pool-fiber0] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:29,764 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE atinterface set status = 'N' WHERE sourcenodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:29,765 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE vlan set status = 'N' WHERE nodeid =? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:29,769 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE iprouteinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:29,769 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE stpnode set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:29,770 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE stpinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:30,985 DEBUG [LinkdScheduler-5 Pool-fiber1] DbAtInterfaceEntry: AtInterfaceEntry.update: SQL insert statment = UPDATE AtInterface SET sourcenodeid = ?,lastpolltime = ? WHERE nodeid = ? AND ipaddr = ?
2010-07-13 12:34:31,000 DEBUG [LinkdScheduler-5 Pool-fiber1] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:31,017 DEBUG [LinkdScheduler-5 Pool-fiber1] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:31,050 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE atinterface set status = 'N' WHERE sourcenodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=44.
2010-07-13 12:34:31,051 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE vlan set status = 'N' WHERE nodeid =? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=44.
2010-07-13 12:34:31,055 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE iprouteinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=44.
2010-07-13 12:34:31,055 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE stpnode set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=44.
2010-07-13 12:34:31,055 DEBUG [LinkdScheduler-5 Pool-fiber1] DbEventWriter: store: SQL statement UPDATE stpinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=44.
2010-07-13 12:34:31,893 DEBUG [LinkdScheduler-5 Pool-fiber0] DbAtInterfaceEntry: AtInterfaceEntry.update: SQL insert statment = UPDATE AtInterface SET sourcenodeid = ?,lastpolltime = ? WHERE nodeid = ? AND ipaddr = ?
2010-07-13 12:34:31,923 DEBUG [LinkdScheduler-5 Pool-fiber0] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:31,925 DEBUG [LinkdScheduler-5 Pool-fiber0] DbIpRouteInterfaceEntry: IpRouteInterfaceEntry.update: SQL insert statment = UPDATE IpRouteInterface SET lastpolltime = ? WHERE nodeid = ? AND routeDest = ?
2010-07-13 12:34:31,942 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE atinterface set status = 'N' WHERE sourcenodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:31,942 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE vlan set status = 'N' WHERE nodeid =? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:31,946 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE iprouteinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:31,947 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE stpnode set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.
2010-07-13 12:34:31,947 DEBUG [LinkdScheduler-5 Pool-fiber0] DbEventWriter: store: SQL statement UPDATE stpinterface set status = 'N' WHERE nodeid = ? AND lastpolltime < ? AND status = 'A'. 0 rows UPDATED for nodeid=46.

4. this has already been reported in bugreports 3871 or 3904

5. if i can/need to help or provide more info please email me.

Environment

Operating System: All Platform: Sun

Acceptance / Success Criteria

None

Attachments

10

Lucidchart Diagrams

Activity

Show:

David Hustace February 20, 2013 at 11:13 AM

I guess we need to work on closing resolved issues to complete the workflow. The user should be closing them but we should close automatically old issues that have been resolved.

Seth Leger October 27, 2011 at 4:31 PM

I'm going to go ahead and mark this issue resolved. I think that the major issues with DAO objects and ifindex values are resolved and these were the main problems preventing people from getting links from the ipRouteTable.

If you have any further issues with linkd, please open new issues with specific instructions on how to reproduce the problems, especially with snmpwalk files from the devices if possible.

I will go ahead and open an issue that documents the primary key collisions (which is the last unresolved issue in this bug). The key collisions seem like an issue that should be solved by using Matt's implementation of the "upsert" database pattern.

Alexander Hoogerhuis October 25, 2011 at 7:00 PM

Some quick feedback after your latest commit: the binary MAC's are not making NPE's anymore. The issue (3) NPE's are still present. It says:

  • "Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pk_iprouteinterface"".

  • \d "pk_iprouteinterface" tells me:
    Index "public.pk_iprouteinterface"
    Column | Type
    -----------+-----------------------
    nodeid | integer
    routedest | character varying(16)
    primary key, btree, for table "public.iprouteinterface"

  • running "SELECT nodeid,routedest,routenexthop from ipRouteInterface"; on my little Linux-rig says:
    nodeid | routedest | routenexthop
    --------------------------------------
    2 | 0.0.0.0 | 80.252.187.97
    2 | 80.252.187.96 | 0.0.0.0
    2 | 94.136.70.48 | 0.0.0.0
    2 | 94.136.90.32 | 0.0.0.0
    2 | 127.0.0.0 | 127.0.0.1
    2 | 172.31.131.0 | 0.0.0.0
    2 | 172.31.132.0 | 0.0.0.0
    2 | 172.31.240.0 | 0.0.0.0
    2 | 172.31.255.64 | 0.0.0.0
    3 | 0.0.0.0 | 80.252.187.97
    3 | 80.252.187.96 | 0.0.0.0
    3 | 169.254.0.0 | 0.0.0.0
    (12 rows)

Which all looks sane, two nodes: itself and the firewall, an all entries are correct.

Seth Leger October 25, 2011 at 10:53 AM

Issue (2) from the previous comment is due to agents that are returning MAC addresses in the ipNetToMediaTable as binary octet strings. This is contrary to the RFC which indicates that you should print the MAC addresses as colon-separated byte values in a string which is the most familiar human-readable format for MAC addresses.

I can change the code that handles this field so that it will also handle the raw binary values. I'll work on this next.

As far as issue (3) goes, this is a database constraint violation when linkd is trying to update the ipRouteInterface table. I'm not exactly sure how linkd handles updates to existing data in this table yet but I'll try and figure this out (or at least improve the logging) after I get done with the MAC address issue.

Alexander Hoogerhuis October 25, 2011 at 5:18 AM

Preliminary results fromt he rig that generated the donated walks:

1. Ooooooh I see links in the GUI.

2. I get a few of these:
2011-10-25 10:47:08,579 WARN [LinkdScheduler-5 Pool-fiber0] IpNetToMediaTableEntry: Cannot decode MAC address: ?.5T..
java.lang.IllegalArgumentException: Cannot decode MAC address: ?.5T..
at org.opennms.core.utils.InetAddressUtils.macAddressStringToBytes(InetAddressUtils.java:540)
at org.opennms.core.utils.InetAddressUtils.normalizeMacAddress(InetAddressUtils.java:569)
at org.opennms.netmgt.linkd.snmp.IpNetToMediaTableEntry.getIpNetToMediaPhysAddress(IpNetToMediaTableEntry.java:154)
at org.opennms.netmgt.linkd.AbstractQueryManager.processIpNetToMediaTable(AbstractQueryManager.java:159)
at org.opennms.netmgt.linkd.HibernateEventWriter.storeSnmpCollection(HibernateEventWriter.java:187)
at org.opennms.netmgt.linkd.Linkd.updateNodeSnmpCollection(Linkd.java:570)
at org.opennms.netmgt.linkd.SnmpCollection.run(SnmpCollection.java:516)
at org.opennms.netmgt.linkd.scheduler.Scheduler$1.run(Scheduler.java:301)
at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:420)
at java.lang.Thread.run(Thread.java:662)

3. I still also get a few of these:

org.springframework.dao.DataIntegrityViolationException: could not insert: [org.opennms.netmgt.model.OnmsIpRouteInterface]; SQL [insert into ipRouteInterface (lastPollTime, nodeI
d, routeDest, routeIfIndex, routeMask, routeMetric1, routeMetric2, routeMetric3, routeMetric4, routeMetric5, routeNextHop, routeProto, routeType, status, id) values (?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [pk_iprouteinterface]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [org.opennms.netm
gt.model.OnmsIpRouteInterface]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:737)
at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate.saveOrUpdate(AbstractDaoHibernate.java:425)
at org.opennms.netmgt.linkd.HibernateEventWriter.saveIpRouteInterface(HibernateEventWriter.java:503)
at org.opennms.netmgt.linkd.AbstractQueryManager.processRouteTable(AbstractQueryManager.java:420)
at org.opennms.netmgt.linkd.HibernateEventWriter.storeSnmpCollection(HibernateEventWriter.java:199)
at org.opennms.netmgt.linkd.Linkd.updateNodeSnmpCollection(Linkd.java:570)
at org.opennms.netmgt.linkd.SnmpCollection.run(SnmpCollection.java:516)
at org.opennms.netmgt.linkd.scheduler.Scheduler$1.run(Scheduler.java:301)
at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:420)
at java.lang.Thread.run(Thread.java:662)

The latter two seems to apply to another test box with linux only also. We don't use maps, so can't comment on that.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created July 13, 2010 at 4:49 PM
Updated February 20, 2013 at 11:13 AM
Resolved October 27, 2011 at 4:31 PM