[rancid] Re: [Fwd: Re: rancid & mysql]

Justin Grote justin at grote.name
Tue Mar 21 20:02:34 UTC 2006


marju jalloh wrote:

> Will you break it down a bit? I`m really not a guru

Everything in rancid is pretty much scripts written in perl, shell, and 
expect except for one hp-specific binary.

The primary rancid script (rancid) is a perl script. If you look on line 
1539, this is where rancid calls the clogin script which does the actual 
connection to the router. clogin accepts -u and -p arguments for 
username and password, so you simply write a few perl lines that do a 
mysql query like "SELECT username, password FROM rancid WHERE 
host=$host" to get the username and password combination for the device, 
and then stick that username and password in as something like -u 
$username, -p $password.

If that's too hard, you could simply write a script in any language of 
your choice that generates a .cloginrc file from the mysql table, and 
sticks that in the rancid homedir, and then set up a cron job to run the 
script every 5 minutes.

-- 
Justin Grote
Network Architect
JWG Networks




More information about the Rancid-discuss mailing list