How *rancid programs can read cloginrc
Ed Ravin
eravin at panix.com
Wed Dec 7 19:04:49 UTC 2005
As part of adding S/Key support into RANCID, I wrote code that lets
a Perl script like rancid/hrancid/jrancid etc. read cloginrc. It
works by having a Perl module call an Expect script that parses cloginrc,
and then adds the post-parsed contents into a Perl structure. Since
all the parsing is done by an Expect program, it's the same results
as if clogin had read the data.
What's the point? One of the architectural problems in RANCID is that
we have no way of specifying options to the *rancid programs.
For example, I once posted that rancid dumps the config twice on
most routers, by sending both "show running" and "write term".
With this feature, you could put router-specific directives for the
*rancid programs into cloginrc. If rancid accepted options from
cloginrc, perhaps I could specify this:
add rancid_no_command * {write term} # don't do this command
to tell rancid to not send that command.
Anyway, I thought this opens up some interesting possibilities for
making RANCID more flexible. To see how the parsing works, open
up the tar file I just sent with the S/Key patches, and read through
the "Rancid/ParseConfig.pm" module and the "otphelper" script that
calls it.
-- Ed
More information about the Rancid-discuss
mailing list