Discussion:
[rancid] Howto use backup files ??
Andrea
2010-01-05 10:27:11 UTC
Permalink
Hi all, i'm using rancid integrated with our network and system
monitoring solution ( i.e. OpenNMS ) .... really awesome tool !!!

Now i'm wondering which is the correct way to use the files in case of a
recovery of some net-appliance after an important failure; say, as an
example, you have to substitute a router with a new one ( same hardware
and firmware, obviously ).

I ask 'cause using viewvc, when i navigate through the cvsroot page to
one of the configs directory, i see ( for each revision file ) only
three links:
-) view
-) annotate
-) select for diffs

..Is there the possibility to have a "download" link in order to see in
the browser page the selected file only ???

...I also know that after that i have to parse the file 'cause i need a
file "purged" from the non-rilevant part ( such as hardware and firmware
part )..

..Any one have faced such a problem ??

Thanks in advance,

--Andrea
Ryan West
2010-01-05 13:17:19 UTC
Permalink
Andrea,
-----Original Message-----
Sent: Tuesday, January 05, 2010 5:27 AM
Hi all, i'm using rancid integrated with our network and system
monitoring solution ( i.e. OpenNMS ) .... really awesome tool !!!
Now i'm wondering which is the correct way to use the files in case of a
recovery of some net-appliance after an important failure; say, as an
example, you have to substitute a router with a new one ( same hardware
and firmware, obviously ).
I ask 'cause using viewvc, when i navigate through the cvsroot page to
one of the configs directory, i see ( for each revision file ) only
-) view
-) annotate
-) select for diffs
..Is there the possibility to have a "download" link in order to see in
the browser page the selected file only ???
If you're talking about a Cisco router / switch / firewall, you can go directly to the file structure under {prefix}/var/{name}/configs and you should see the config there. You can paste the entire file into the device as the !'s are treated as comment lines. I haven't used viewvc before, but the view option would seem the correct choice. I've recompiled my RANCID using SVN and use the websvn frontend to view my diffs and download config's using it for customer requests and system failures.

HTH,

-ryan
Steve Teti
2010-01-05 13:27:03 UTC
Permalink
Post by Andrea
I ask 'cause using viewvc, when i navigate through the cvsroot page to
one of the configs directory, i see ( for each revision file ) only
-) view
-) annotate
-) select for diffs
..Is there the possibility to have a "download" link in order to see in
the browser page the selected file only ???
Take a look at the allowed_views option in viewvc.conf. Adding "co" to
the list of views should add a "download" link to your viewvc pages.
Post by Andrea
...I also know that after that i have to parse the file 'cause i need a
file "purged" from the non-rilevant part ( such as hardware and firmware
part )..
I believe the non-relevant parts are prepended with a "!", which should
allow you to paste or TFTP the entire file into a Cisco router with no
ill effects. Also, if you have FILTER_PWDS enabled in rancid.conf (I
believe it's enabled by default), all your passwords will have been
stripped out of the stored config files. Make sure you have the
relevant passwords stored elsewhere to replace into the config file.

Steve
john heasley
2010-01-05 17:43:31 UTC
Permalink
Post by Steve Teti
Post by Andrea
I ask 'cause using viewvc, when i navigate through the cvsroot page to
one of the configs directory, i see ( for each revision file ) only
-) view
-) annotate
-) select for diffs
..Is there the possibility to have a "download" link in order to see in
the browser page the selected file only ???
Take a look at the allowed_views option in viewvc.conf. Adding "co" to
the list of views should add a "download" link to your viewvc pages.
Post by Andrea
...I also know that after that i have to parse the file 'cause i need a
file "purged" from the non-rilevant part ( such as hardware and firmware
part )..
I believe the non-relevant parts are prepended with a "!", which should
allow you to paste or TFTP the entire file into a Cisco router with no
ill effects. Also, if you have FILTER_PWDS enabled in rancid.conf (I
believe it's enabled by default), all your passwords will have been
stripped out of the stored config files. Make sure you have the
relevant passwords stored elsewhere to replace into the config file.
FILTER_PWDS is off (commented) by default. caveat is that if you're
using a linux pkg, they may have changed the default to "help" you.
Post by Steve Teti
Steve
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Chris Gauthier
2010-01-05 18:53:53 UTC
Permalink
The Ubuntu packages are configured to filter out the passwords by default.

--Chris

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return."
-Leonardo da Vinci

-----Original Message-----
From: rancid-discuss-***@shrubbery.net [mailto:rancid-discuss-***@shrubbery.net] On Behalf Of john heasley
Sent: Tuesday, January 05, 2010 9:44 AM
To: Steve Teti
Cc: ***@comune.modena.it; rancid-***@shrubbery.net
Subject: [rancid] Re: Howto use backup files ??
Post by Steve Teti
Post by Andrea
I ask 'cause using viewvc, when i navigate through the cvsroot page to
one of the configs directory, i see ( for each revision file ) only
-) view
-) annotate
-) select for diffs
..Is there the possibility to have a "download" link in order to see in
the browser page the selected file only ???
Take a look at the allowed_views option in viewvc.conf. Adding "co" to
the list of views should add a "download" link to your viewvc pages.
Post by Andrea
...I also know that after that i have to parse the file 'cause i need a
file "purged" from the non-rilevant part ( such as hardware and firmware
part )..
I believe the non-relevant parts are prepended with a "!", which should
allow you to paste or TFTP the entire file into a Cisco router with no
ill effects. Also, if you have FILTER_PWDS enabled in rancid.conf (I
believe it's enabled by default), all your passwords will have been
stripped out of the stored config files. Make sure you have the
relevant passwords stored elsewhere to replace into the config file.
FILTER_PWDS is off (commented) by default. caveat is that if you're
using a linux pkg, they may have changed the default to "help" you.
Post by Steve Teti
Steve
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Andrea
2010-01-07 11:02:52 UTC
Permalink
Post by john heasley
Post by Steve Teti
Post by Andrea
I ask 'cause using viewvc, when i navigate through the cvsroot page to
one of the configs directory, i see ( for each revision file ) only
-) view
-) annotate
-) select for diffs
..Is there the possibility to have a "download" link in order to see in
the browser page the selected file only ???
Take a look at the allowed_views option in viewvc.conf. Adding "co" to
the list of views should add a "download" link to your viewvc pages.
Post by Andrea
...I also know that after that i have to parse the file 'cause i need a
file "purged" from the non-rilevant part ( such as hardware and firmware
part )..
I believe the non-relevant parts are prepended with a "!", which should
allow you to paste or TFTP the entire file into a Cisco router with no
ill effects. Also, if you have FILTER_PWDS enabled in rancid.conf (I
believe it's enabled by default), all your passwords will have been
stripped out of the stored config files. Make sure you have the
relevant passwords stored elsewhere to replace into the config file.
FILTER_PWDS is off (commented) by default. caveat is that if you're
using a linux pkg, they may have changed the default to "help" you.
Post by Steve Teti
Steve
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Hi all !!
First of all, thanks a lot for your quick answers !!

In effect, i modified the "viewvc.conf" file adding "co" to the
"allowed_views" section.

Magically now i notice the "download" link on the GUI .....

But now i'm facing a strange ( almost to me :-( ) thing:

I make this test: i compare the file rancid backed-up with the one
generated by the download link ( i.e. a page in my browser showing the
config file as it should be seen ...);
RESULT: the two files differs but apparently the contents are the same (
i mean looking with VI both of them ).

So i suppose that some strange characters ( not visible as ASCII ??? )
are added by the browser, if only i noticed that saving the same file
by right -click on the download link and selecting "save as " gives
no problem on the generated file....

Some hints on solving this ???
It's not a big problem, i'm just curios of understanding it better ...

--Andrea
Andrea
2010-01-07 12:48:18 UTC
Permalink
Post by Andrea
I make this test: i compare the file rancid backed-up with the one
generated by the download link ( i.e. a page in my browser showing
the config file as it should be seen ...);
RESULT: the two files differs but apparently the contents are the
same ( i mean looking with VI both of them ).
So i suppose that some strange characters ( not visible as ASCII ???
) are added by the browser, if only i noticed that saving the same
file by right -click on the download link and selecting "save as
" gives no problem on the generated file....
Hi Andrea,
If the two files "look" the same, how do you know that they are
different? File size, md5sum, diff? There's many reasons the binary
contents could be different - extra non-printing characters, different
line endings, extra line breaks at the end of the file. As long as
the text contents are the same, I wouldn't worry about it.
At this point, this is more of a a "viewvc" question than a "rancid"
question, so you may want to ask your question on a viewvc forum.
Steve
Hi Steve,

the two files have different size; i also think that it's a "viewvc"
question rather than a rancid one, but i was wondering if any-one of you
have encountered such a problem.

Thanks again,

--Andrea
Simon Leinen
2010-01-17 22:09:31 UTC
Permalink
Post by Andrea
I make this test: i compare the file rancid backed-up with the one
generated by the download link ( i.e. a page in my browser showing the
config file as it should be seen ...);
RESULT: the two files differs but apparently the contents are the same (
i mean looking with VI both of them ).
So i suppose that some strange characters ( not visible as ASCII ??? )
are added by the browser, if only i noticed that saving the same file
by right -click on the download link and selecting "save as " gives
no problem on the generated file....
Possibly different end-of-line conventions. Some systems use LF (ASCII
10) to terminate lines, others CR+LF (ASCII 13 + ASCII 10), others CR.
Post by Andrea
Some hints on solving this ???
Dump the first parts of the files in hex using e.g. "od -x" and check
whether this can explain the differences. Note that in hex, CR is 0d
and LF is 0a.

Good luck,
--
Simon.
Continue reading on narkive:
Loading...