Integrating rancid with OpenNMS...

Andrew Fort afort at choqolat.org
Tue Mar 29 04:38:49 UTC 2005


john heasley wrote:

> Mon, Mar 28, 2005 at 11:13:29AM -0600, Brad Guillory:
> 
>>I am about to (today) integrate Rancid with an OpenNMS installation that
>>I have.  The idea is that if new routers are discovered in OpenNMS I
>>will add them to /etc/hosts, cloginrc and router.db.  Has anyone done
>>this?  I am planning on writing this in perl; and I have already written
>>a password basher that produces the proper output for cloginrc and
>>router.db.  Here are the scripts that I plan to write today (unless
>>someone can point me to something similar)
>>
>>rancid_mv <oldname> <newname>
>>  dangerous cvs hack + change in /etc/hosts, router.db and cloginrc
>>rancid_reip <oldip> <newip>
>>  simple change in /etc/hosts
>>rancid_new <name> <ip> [<description>]
>>  detect password and os, make entries in /etc/hosts, router.db and cloginrc
>>rancid_delete <name>
>>  delete entries in /etc/hosts, router.db and cloginrc
> 
> 
> I am not familiar with opennms, but you might consider entirely re-creating
> the files on some regular basis than bother with intricacies of editing.  That
> is what I do, but the source is a database.

If your source keeps track of whether the device is 'up' or 'down' or in 
'testing' (unmanaged) state, this will work nicely. Putting anything in 
that third column in the router.db other than 'up' will suspend collection.

When you don't have any concept of whether a device should be managable 
now (c.f., a 'collect config' flag on the device), you have to treat the 
devices as up, and you will thus have to expect to more carefully read 
the 'device down' emails the admin aliases get from RANCID (or ignore them).

Since the number of absolute records, even for a large network, is 
relatively small, your build scripts could quite reasonably run every hour..

-andrew




More information about the Rancid-discuss mailing list