On Mon, 2008-09-29 at 11:01 -0400, Matt Brozowski wrote:
> 
> 
> On Mon, Sep 29, 2008 at 7:27 AM, Alex Bennee <[EMAIL PROTECTED]> wrote:
>         I was having a problem with nodes imported by the model
>         importer not
>         listing showing the SNMP interface correctly if it failed to
>         read the
>         ifTable on import.
>         
>         There doesn't seem to be any particular reason to pull it out
>         while
>         enumerating the interfaces if it can be set earlier. Comments?
> 
> I'm not sure I understand the exact problem you are trying to solve.
> Is the importer failing to set the isSnmpPrimary flag on interfaces?

No the importer is setting the flag correctly. The Primary status of the
interface is reflected in the database. However as the SNMP collection
has failed for that node (probably because it was down when the importer
ran). As a result the ifTable/sysInfo stuff hasn't been populated in the
database.

When node.jsp then fetches the information for the node it doesn't see
there is a primary SNMP interface. The
("P".equals(intf.getIsSnmpPrimary())) test fails. This means things like
the "Update SNMP" button don't exist on the node information display.

Does that explanation make sense?


>  
>         ---
>          .../opennms/web/element/NetworkElementFactory.java |   11
>         ++++++++++-
>          1 files changed, 10 insertions(+), 1 deletions(-)
>         
>         diff --git
>         
> a/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java
>  
> b/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java
>         index 562727d..2a71b72 100644
>         ---
>         
> a/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java
>         +++
>         
> b/opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactory.java
>         @@ -984,6 +984,15 @@ public class NetworkElementFactory
>         extends Object {
>                         intf.m_isManaged = ((String)
>         element).charAt(0);
>                     }
>         
>         +            // isSnmpPrimary may not get picked up if the
>         initial collection failed
>         +            // (e.g. the node was down at the time of import)
>         If we don't fill in the
>         +            // info here it will get lost
>         +            element = rs.getString("isSnmpPrimary");
>         +            if (element != null) {
>         +                intf.m_isSnmpPrimary = (String) element;
>         +            }
>         +
>         +
>                     element = rs.getTimestamp("ipLastCapsdPoll");
>                     if (element != null)
>                         intf.m_ipLastCapsdPoll =
>         Util.formatDateToUIString(new Date(((Timestamp)
>         element).getTime()));
>         @@ -1028,7 +1037,7 @@ public class NetworkElementFactory
>         extends Object {
>                         pstmt = conn.prepareStatement("SELECT
>         issnmpprimary FROM ipinterface WHERE nodeid=? AND ifindex=?
>         AND ipaddr=?");
>                         pstmt.setInt(1, intfs[i].getNodeId());
>                         pstmt.setInt(2, intfs[i].getIfIndex());
>         -               pstmt.setString(3, intfs[i].getIpAddress());
>         +                pstmt.setString(3, intfs[i].getIpAddress());
>         
>                         rs = pstmt.executeQuery();
> 
> 
> If the importer doesn't set the flag then the above certainly won't
> fix it?
> 
> Again if you could be the detailed explanation of the bug then I could
> validate this patch there?

As the database is correct the patch does fix the cosmetic issues noted
on the node.jsp page for me. However I seem to be having problems
getting the SNMP information updated for nodes that I do know are up
(i.e I can snmpget the info from the command line).

Does OpenNMS rescan SNMP information for nodes it failed to scan
initially? When do these rescans happen?


> 
> Thanks for your contribution!
> 
> Matt Brozowski
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________ Please read the OpenNMS 
> Mailing List FAQ: http://www.opennms.org/index.php/Mailing_List_FAQ 
> opennms-devel mailing list To *unsubscribe* or change your subscription 
> options, see the bottom of this page: 
> https://lists.sourceforge.net/lists/listinfo/opennms-devel
-- 
Alex Bennee, Software Engineer
Space is to place as eternity is to time. -- Joseph Joubert


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to