Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-5195

reparenting of snmp interfaces fails

    XMLWordPrintable

    Details

      Description

      following error msg in capsd.log

      2012-02-19 11:56:15,224 ERROR [Capsd Rescan Pool-fiber1] RescanProcessor: SQLException while updating interface: 217.198.242.3 on nodeid: 8
      2012-02-19 11:56:15,224 ERROR [Capsd Rescan Pool-fiber1] RescanProcessor: Error updating records for node ID 8: org.postgresql.util.PSQLException: ERROR: column "ipaddr" does not exist
      Position: 8
      org.postgresql.util.PSQLException: ERROR: column "ipaddr" does not exist
      Position: 8
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
      at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
      at org.opennms.netmgt.capsd.RescanProcessor.reparentInterface(RescanProcessor.java:2029)
      at org.opennms.netmgt.capsd.RescanProcessor.updateInterface(RescanProcessor.java:934)
      at org.opennms.netmgt.capsd.RescanProcessor.updateInterfaces(RescanProcessor.java:455)
      at org.opennms.netmgt.capsd.RescanProcessor.run(RescanProcessor.java:2912)
      at org.opennms.netmgt.capsd.Scheduler$NodeInfo.run(Scheduler.java:181)
      at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:420)
      at java.lang.Thread.run(Thread.java:662)

      following change seems to fix the problem (snmpinterface table does not have column ipaddr (any more?))

      — RescanProcessor.java.orig Tue Feb 7 18:41:35 2012
      +++ RescanProcessor.java Mon Feb 20 20:28:31 2012
      @@ -105,11 +105,11 @@

      final static String SQL_DB_REPARENT_IP_INTERFACE = "UPDATE ipinterface SET nodeID=? WHERE nodeID=? AND ipaddr=? AND isManaged!='D'";

      • final static String SQL_DB_REPARENT_SNMP_IF_LOOKUP = "SELECT ipaddr FROM snmpinterface " + "WHERE nodeID=? AND snmpifindex=?";
        + final static String SQL_DB_REPARENT_SNMP_IF_LOOKUP = "SELECT id FROM snmpinterface " + "WHERE nodeID=? AND snmpifindex=?";

      final static String SQL_DB_REPARENT_SNMP_IF_DELETE = "DELETE FROM snmpinterface " + "WHERE nodeID=? AND snmpifindex=?";

      • final static String SQL_DB_REPARENT_SNMP_INTERFACE = "UPDATE snmpinterface SET nodeID=? " + "WHERE nodeID=? AND ipaddr=? AND snmpifindex=?";
        + final static String SQL_DB_REPARENT_SNMP_INTERFACE = "UPDATE snmpinterface SET nodeID=? " + "WHERE nodeID=? AND snmpifindex=?";

      final static String SQL_DB_REPARENT_IF_SERVICES_LOOKUP = "SELECT serviceid FROM ifservices " + "WHERE nodeID=? AND ipaddr=? AND ifindex = ? " + "AND status!='D'";

      @@ -2055,8 +2055,7 @@

      snmpInterfaceStmt.setInt(1, newNodeId);
      snmpInterfaceStmt.setInt(2, oldNodeId);

      • snmpInterfaceStmt.setString(3, ipaddr);
      • snmpInterfaceStmt.setInt(4, ifIndex);
        + snmpInterfaceStmt.setInt(3, ifIndex);

      // execute and log
      snmpInterfaceStmt.executeUpdate();

        Attachments

          Activity

            People

            • Assignee:
              ranger Benjamin Reed
              Reporter:
              weiss@uni-mainz.de Juergen Weiss
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: