Discussion:
[rancid] archive cisco command and rancid
alligator94
2015-03-23 13:47:13 UTC
Permalink
Hi,

We use rancid for years now. We manage too much cisco devices, so rancid
runs daily during almost 15 hours.

As, most part of the time, the configurations have not changed, I would like
to use the cisco archive command to ftp the configuration when it is saved
in the cisco device. So we could run rancid only once a week .

Is there a way to process the files sent by ftp as input to rancid to have
the formatting and the differences processed and stored as with native
rancid?

Thanks

Gilles
Heasley
2015-03-23 16:15:55 UTC
Permalink
Hi,
We use rancid for years now. We manage too much cisco devices, so rancid runs daily during almost 15 hours.
Ignoring the question below for now. 15hours seems outrageous, so tell us more about your environment please. How many devices, models, connectivity, rancid host, rancid.conf PAR count, etc. i collect about 450 devices each hour without issue.
As, most part of the time, the configurations have not changed, I would like to use the cisco archive command to ftp the configuration when it is saved in the cisco device. So we could run rancid only once a week .
Is there a way to process the files sent by ftp as input to rancid to have the formatting and the differences processed and stored as with native rancid?
Thanks
Gilles
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
alligator94
2015-03-23 17:35:18 UTC
Permalink
We use rancid to backup daily around 3700 cisco devices (routers and switches + some WAP and FW) all around the world and let’s say that 10 percent randomly may not be reachable because they are switched off at night or due to any other connectivity issue. As we have the standard rancid configuration, I think that there are 3 retries, so it may take time.

I have no access right now to the rancid config, but several clogin run in //.



We have a lot of different models of cisco devices, connected through a stable and not overloaded mpls network or using ipsec tunnels. Some use satellite connectivity in the far east countries.



Rancid runs on a separate linux system, so it is not disturbing while rancid run is below 24hours . But I was wondering if, as we don’t change the devices configuration very often, once a week would be enough if we use the “archive “ cisco command to store the updated config. Today we run rancid on a daily basis not to miss any change in the devices configurations.



Regards

Gilles







From: Heasley [mailto:***@shrubbery.net]
Sent: lundi 23 mars 2015 17:16
To: alligator94
Cc: <rancid-***@shrubbery.net>
Subject: Re: [rancid] archive cisco command and rancid



Am 23.03.2015 um 08:47 schrieb alligator94 < <mailto:***@laposte.net> ***@laposte.net>:



Hi,

We use rancid for years now. We manage too much cisco devices, so rancid runs daily during almost 15 hours.



Ignoring the question below for now. 15hours seems outrageous, so tell us more about your environment please. How many devices, models, connectivity, rancid host, rancid.conf PAR count, etc. i collect about 450 devices each hour without issue.





As, most part of the time, the configurations have not changed, I would like to use the cisco archive command to ftp the configuration when it is saved in the cisco device. So we could run rancid only once a week .

Is there a way to process the files sent by ftp as input to rancid to have the formatting and the differences processed and stored as with native rancid?

Thanks

Gilles
'Heasley'
2015-03-23 18:26:53 UTC
Permalink
We use rancid to backup daily around 3700 cisco devices (routers and switches + some WAP and FW) all around the world and let’s say that 10 percent randomly may not be reachable because they are switched off at night or due to any other connectivity issue. As we have the standard rancid configuration, I think that there are 3 retries, so it may take time.
I have no access right now to the rancid config, but several clogin run in //.
We have a lot of different models of cisco devices, connected through a stable and not overloaded mpls network or using ipsec tunnels. Some use satellite connectivity in the far east countries.
A few things I can suggest to improve the collection time:
- since you have a lot of devices (probably) with long RTTs
- increase rancid.conf:PAR_COUNT. Perhaps double the number of CPUs.
most processes will be waiting on the network. if the host *only*
does rancid, increase it furture - perhaps 4 times. you will have
to play with the value a bit to find your acceptable load vs time
comfort.
- if you can separate topologically distanct devices from near by
group, you could use <group>/rancid.conf to tailor PAR_COUNT for the
workload w/ 3.2.
- if devices may be turned-off or may suffer outages often, these two could be
separated into a separate group and use <group>/rancid.conf to lower the
MAX_ROUNDS variable.
- you could also try lowering the timeout in cloginrc for devices that are
often inaccessible.
- you may also consider switching to svn, which is faster than cvs. or git,
but please create a test instance for yourself before moving to git as the
support is new.
- rancid.conf:NOPIPE=YES will improve performance of the perl part of a
collection a little.
- also, see the FAQ for triggering rancid runs from syslog configuration
change messages. Use that for daily activity and run once a week to CYA.
Rancid runs on a separate linux system, so it is not disturbing while rancid run is below 24hours . But I was wondering if, as we don’t change the devices configuration very often, once a week would be enough if we use the “archive “ cisco command to store the updated config. Today we run rancid on a daily basis not to miss any change in the devices configurations.
As, most part of the time, the configurations have not changed, I would like to use the cisco archive command to ftp the configuration when it is saved in the cisco device. So we could run rancid only once a week .
Is there a way to process the files sent by ftp as input to rancid to have the formatting and the differences processed and stored as with native rancid?
I've not tried transfering the archives from devices. there is no support
currently for reading the ftp file, but it is of course entirely possible
to add such a mechanism. but, it would still need to connect to the device
to collect other info, or at least show version.
'Heasley'
2015-03-23 19:12:42 UTC
Permalink
I am thinking at <group>/rancid.conf that I didn't know.
thats new in 3.2 (or 3.<whenever i added it>).
- since you have a lot of devices (probably) with long RTTs
- increase rancid.conf:PAR_COUNT. Perhaps double the number of CPUs.
most processes will be waiting on the network. if the host *only*
does rancid, increase it furture - perhaps 4 times. you will have
s/future/further/ - brain in different place than fingers.
to play with the value a bit to find your acceptable load vs time
comfort.
Alan McKinnon
2015-03-24 07:31:32 UTC
Permalink
Post by 'Heasley'
We use rancid to backup daily around 3700 cisco devices (routers and switches + some WAP and FW) all around the world and let’s say that 10 percent randomly may not be reachable because they are switched off at night or due to any other connectivity issue. As we have the standard rancid configuration, I think that there are 3 retries, so it may take time.
I have no access right now to the rancid config, but several clogin run in //.
We have a lot of different models of cisco devices, connected through a stable and not overloaded mpls network or using ipsec tunnels. Some use satellite connectivity in the far east countries.
- since you have a lot of devices (probably) with long RTTs
- increase rancid.conf:PAR_COUNT. Perhaps double the number of CPUs.
most processes will be waiting on the network. if the host *only*
does rancid, increase it furture - perhaps 4 times. you will have
to play with the value a bit to find your acceptable load vs time
comfort.
- if you can separate topologically distanct devices from near by
group, you could use <group>/rancid.conf to tailor PAR_COUNT for the
workload w/ 3.2.
- if devices may be turned-off or may suffer outages often, these two could be
separated into a separate group and use <group>/rancid.conf to lower the
MAX_ROUNDS variable.
- you could also try lowering the timeout in cloginrc for devices that are
often inaccessible.
- you may also consider switching to svn, which is faster than cvs. or git,
but please create a test instance for yourself before moving to git as the
support is new.
- rancid.conf:NOPIPE=YES will improve performance of the perl part of a
collection a little.
- also, see the FAQ for triggering rancid runs from syslog configuration
change messages. Use that for daily activity and run once a week to CYA.
I have some experience with setups like this:

More than 8000 CE devices (mostly Cisco) distributed throughout Africa
over whatever links happened to be available at the time. The list of
devices was constantly changing, they may or may not be up at any given
time, the username/password may or may not follow the standard, and the
device in question may or may not even exist at all in the real world.

With 2.3.8 on a single-CPU VM with 512MB RAM, I got this to run in about
4 hours:

- Crank PAR_COUNT way up. I had mine set to 50 IIRC.
- Split your devices up into groups of a few hundred each
- Set the telnet/ssh timeout as high as you need it to be to work
reliably 95% of the time

The rancid perl processes are all shared, and the code spends most of
it's time waiting on the network as characters come in one by one. The
actual amount of CPU work done per process is miniscule and disk
accesses are so infrequent you can almost ignore their effect, so don't
be scared to set PAR_COUNT very high.

top and load measurements tend to go very high with rancid, ignore those
numbers - it's a false positive because the machine is doing so much
waiting on the network.

I found, somewhat counter-intuitively, that with one large group of 8000
devices, cvs itself was adding a significant amount of time with each
commit. Maybe cvs was misconfigured on my end, but it got much better
when I created 26 groups (initial letter of the hostname) so I never
took the time to investigate cvs further.

I also had MAX_ROUNDS set to 0 so rancid never retried a given device.
My logic was that connectivity to the device was not my problem at all
so I didn't need to deal with it, and rancid would simply poll the
device again in 12 hours (mine ran twice a day). The OP might not have
the freedom to work under a policy like this though.
--
Alan McKinnon
***@gmail.com
rdrake
2015-03-23 18:29:52 UTC
Permalink
Post by alligator94
We use rancid to backup daily around 3700 cisco devices (routers and
switches + some WAP and FW) all around the world and let’s say that 10
percent randomly may not be reachable because they are switched off at
night or due to any other connectivity issue. As we have the standard
rancid configuration, I think that there are 3 retries, so it may take
time.
I have no access right now to the rancid config, but several clogin run in //.
We have a lot of different models of cisco devices, connected through
a stable and not overloaded mpls network or using ipsec tunnels. Some
use satellite connectivity in the far east countries.
Rancid runs on a separate linux system, so it is not disturbing while
rancid run is below 24hours . But I was wondering if, as we don’t
change the devices configuration very often, once a week would be
enough if we use the “archive “ cisco command to store the updated
config. Today we run rancid on a daily basis not to miss any change in
the devices configurations.
Regards
Gilles
You could do a few things. If you're running tacacs you could kickoff
an individual rancid-run on a single node after a login to that node.
Or if you're using a syslog server you can watch for "Configured from "
in the logs and kick it off from that.

If you were to use the ftp config you would need to heavily modify the
rancid script. It would need to detect that the file was newer than
what was saved in CVS, then grab the comments out of the existing CVS
file, combine that with the "sh run" from the ftp. This would fake
things out and the comments would be wrong on some devices and that
would be .. not ideal.

Either that, or you could strip all the comments from both files and
diff them then only run rancid on files that are different. That lets
you save lots of runtime and gives you the correct answers, so it would
be much better than the above, at the cost of a little more network traffic.

If you did these I would still advise you to do a full run once a week.
Alligator
2015-03-23 19:16:23 UTC
Permalink
Thanks a lot.

As you say, it will need to heavily modify the rancid script.



Thanks for the useful tips.



Regards,

Gilles.



From: Rancid-discuss [mailto:rancid-discuss-***@shrubbery.net] On Behalf
Of rdrake
Sent: lundi 23 mars 2015 19:30
To: rancid-***@shrubbery.net
Subject: Re: [rancid] archive cisco command and rancid



On 03/23/2015 01:35 PM, alligator94 wrote:

We use rancid to backup daily around 3700 cisco devices (routers and
switches + some WAP and FW) all around the world and let's say that 10
percent randomly may not be reachable because they are switched off at night
or due to any other connectivity issue. As we have the standard rancid
configuration, I think that there are 3 retries, so it may take time.

I have no access right now to the rancid config, but several clogin run in
//.



We have a lot of different models of cisco devices, connected through a
stable and not overloaded mpls network or using ipsec tunnels. Some use
satellite connectivity in the far east countries.



Rancid runs on a separate linux system, so it is not disturbing while rancid
run is below 24hours . But I was wondering if, as we don't change the
devices configuration very often, once a week would be enough if we use the
"archive " cisco command to store the updated config. Today we run rancid on
a daily basis not to miss any change in the devices configurations.



Regards

Gilles







You could do a few things. If you're running tacacs you could kickoff an
individual rancid-run on a single node after a login to that node. Or if
you're using a syslog server you can watch for "Configured from " in the
logs and kick it off from that.

If you were to use the ftp config you would need to heavily modify the
rancid script. It would need to detect that the file was newer than what
was saved in CVS, then grab the comments out of the existing CVS file,
combine that with the "sh run" from the ftp. This would fake things out
and the comments would be wrong on some devices and that would be .. not
ideal.

Either that, or you could strip all the comments from both files and diff
them then only run rancid on files that are different. That lets you save
lots of runtime and gives you the correct answers, so it would be much
better than the above, at the cost of a little more network traffic.

If you did these I would still advise you to do a full run once a week.
Jethro R Binks
2015-03-24 09:48:05 UTC
Permalink
Post by rdrake
If you were to use the ftp config you would need to heavily modify the
rancid script. It would need to detect that the file was newer than
what was saved in CVS, then grab the comments out of the existing CVS
file, combine that with the "sh run" from the ftp. This would fake
things out and the comments would be wrong on some devices and that
would be .. not ideal.
On this point, I recommend original poster Google for "wrancid" and
"wraprancid". But neither developed for rancid 3.x so far. They allow
you to run ar arbitrary command to fetch a config by whatever means, which
can then be processed.

Jethro.

. . . . . . . . . . . . . . . . . . . . . . . . .
Jethro R Binks, Network Manager,
Information Services Directorate, University Of Strathclyde, Glasgow, UK

The University of Strathclyde is a charitable body, registered in
Scotland, number SC015263.

Loading...