Discussion:
[rancid] Rancid and TFTP?
PIERCE, STEVEN T (STEVE), ATTOPS
2008-04-03 15:24:10 UTC
Permalink
This is slightly off-topic, but I'd appreciate any input from others who
may have encountered the same issue.

I run a customer proof of concept lab and I am a happy user of RANCID
and CVSWeb. I like being able to view old configs from various
engagements, see diffs, etc. The one missing element is the ability for
me to log into a remote Cisco device and do a simple "copy tftp flash"
in order to load an older configuration from the server running RANCID.
Since RANCID doesn't store complete configs, I can't figure out a way to
do this.

Has anyone developed a way to archive configs with RANCID and still be
able to easily tftp complete configs to a remote device? I can't seem
to figure this out. Or, are there other opensource tools that would
fill this need?

Thanks.
andrew.brennan+
2008-04-03 17:01:28 UTC
Permalink
You would either need to wrap the process doing the "login, copy" with a
time/date that would be passed to cvs (export the correct file to a known
filename, login to the switch, tftp known file to flash) or you could put
a file lookup function into the TFTPD (I looked for hooks in the remap
function, but I don't see what I think would be needed).

Or, you might be able to get both functions rolled together by letting a
TFTPD access the CVS repository via CvsFS (http://cvsfs.sourceforge.net/)
and not have to write any scripts/code at all. Haven't looked into this
approach, I only thought of it a second ago. :)

andrew.
Post by PIERCE, STEVEN T (STEVE), ATTOPS
This is slightly off-topic, but I'd appreciate any input from others who
may have encountered the same issue.
I run a customer proof of concept lab and I am a happy user of RANCID
and CVSWeb. I like being able to view old configs from various
engagements, see diffs, etc. The one missing element is the ability for
me to log into a remote Cisco device and do a simple "copy tftp flash"
in order to load an older configuration from the server running RANCID.
Since RANCID doesn't store complete configs, I can't figure out a way to
do this.
Has anyone developed a way to archive configs with RANCID and still be
able to easily tftp complete configs to a remote device? I can't seem
to figure this out. Or, are there other opensource tools that would
fill this need?
Thanks.
Rob Skoog
2008-04-03 17:25:33 UTC
Permalink
Post by PIERCE, STEVEN T (STEVE), ATTOPS
This is slightly off-topic, but I'd appreciate any input from others who
may have encountered the same issue.
I run a customer proof of concept lab and I am a happy user of RANCID
and CVSWeb. I like being able to view old configs from various
engagements, see diffs, etc. The one missing element is the ability for
me to log into a remote Cisco device and do a simple "copy tftp flash"
in order to load an older configuration from the server running RANCID.
Since RANCID doesn't store complete configs, I can't figure out a way to
do this.
Has anyone developed a way to archive configs with RANCID and still be
able to easily tftp complete configs to a remote device? I can't seem
to figure this out. Or, are there other opensource tools that would
fill this need?
Thanks.
------------------------------------------------------------------------
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
I've thought about doing this before, but haven't yet. you could use a
shell script with clogin to do it though through cron.

Something like: (untested)

#!/bin/sh
#pull config
clogin device -c "copy flash tftp:\\ip\newConfig.txt"
#compare to previous config
if ! diff TFTPROOT\newConfig.txt TFTPROOT\CurrentConfig.txt
#config is different
then date=$(date --iso-8601=seconds)
#archive old config
mv TFTPROOT\CurrentConfig.txt ARCHIVE\config.$date.txt
#make new config current
mv TFTPROOT\newConfig.txt TFTPROOT\CurrentConfig.txt
#config is the same
else rm TFTPROOT\newConfig.txt
fi


Anyways, I think you get the idea... You could probably even check it
into CVS as mentioned by Andrew if you wanted to get really ambitious.
I'm not sure though how you could pull existing information from the CVS
rancid makes and load it directly as a config. Someone else with more
rancid+cvs knowledge might be able to answer your question better.

Regards,
Rob Skoog

Loading...