[RANCID] [PATCH] Fallback to ip when searching for rancidnode

Description

We've got a little issue with the current Rancid integration : our nodeLabels are arbitrary (not ip, not DNS names). So, in our Rancid configuration (router.db), we use primary IP addresses as names.

And, with the current SVN HEAD, InventoryService uses nodeLabel and supposes it's the name in router.db.

This patches adds a fallback : when the node cannot be found by label, it tries to use primaryInterface or the first interface it finds.

It's tested and works for me 😉

I'm puzzled about :
OnmsIpInterface primaryInterface = node.getPrimaryInterface();

It should give me the primaryInterface, but doesn't, even for nodes where there is a 'P' in the column issnmpprimary in the ipinterface table.

Am I getting the primary interface concept right ?

So I borrowed code from another function in RancidProvisioningAdapter ( getSuitableIpForRancid() ) and that's why, in the patch, I get all interfaces and pick the first. Not very elegant, but it works.

Environment

Operating System: Linux Platform: PC

Acceptance / Success Criteria

None

Attachments

2
  • 29 Jun 2009, 06:14 AM
  • 03 Jun 2009, 04:25 AM

Lucidchart Diagrams

Activity

Show:

Philippe Guillebert January 5, 2010 at 8:18 AM

Well, the first patch is for opennms code ( InventoryService.java ). It falls back to primary IP address when the rancid node cannot be found using ONMS nodelabel.

I kinda hijacked the same bug to post the second patch (rancid patch updated to the latest rancid release) but it's unrelated to the fallback feature.

Former user January 5, 2010 at 8:04 AM

Philippe, I see that the patch is for Rancid. So Rocco should oversee this.I worked on the client side.

BTW we plan to requite the client using only javascript so that we don't use any servlet.

We can try to address the requirements there.

crescens January 5, 2010 at 7:53 AM

Any update available? I have the same "problem". Maybe someone can accept the solution for 1.7.9

Former user July 23, 2009 at 5:52 PM

I'll discuss this tomorrow with Rocco.

Benjamin Reed July 23, 2009 at 11:34 AM

Anyone? Antonio? Rocco?

Details

Assignee

Reporter

Affects versions

Priority

PagerDuty

Created June 3, 2009 at 4:23 AM
Updated September 21, 2021 at 9:14 PM

Flag notifications