Discussion:
[rancid] Run secondary login / collection script for entries in router.db? Anyone doing something like this?
Ni Ne
2018-10-02 18:15:20 UTC
Permalink
I am curious to see the effort behind having the default configuration backup contain only the device configuration, and push other things like file system, interface status, inventory, etc, into a separate file. The main reason is I want to greatly increase the amount of ancillary data retrieved for each device, but don't want to clutter the configuration file itself, so disaster recovery is simpler.

Is anyone doing this in a stream-lined fashion, where secondary login scripts are called for each device present in a router.db file? Ideally the administrator would only need to add a device once, and then based on vendor type that secondary login process would run transparently.

I am still digging (back) into the RANCID internals to see how easy this would be to accomplish, so just curious if anyone is doing something like this already.

Thanks!

-Aaron
Howard Jones
2018-10-02 18:46:05 UTC
Permalink
Probably easier to do it the other way around - collect it all in one
big swoop. The extra stuff is all done as comments anyway. And
postprocess those collected files into a second directory/file/repo
for the just-config parts.
Post by Ni Ne
I am curious to see the effort behind having the default configuration backup contain only the device configuration, and push other things like file system, interface status, inventory, etc, into a separate file. The main reason is I want to greatly increase the amount of ancillary data retrieved for each device, but don't want to clutter the configuration file itself, so disaster recovery is simpler.
Is anyone doing this in a stream-lined fashion, where secondary login scripts are called for each device present in a router.db file? Ideally the administrator would only need to add a device once, and then based on vendor type that secondary login process would run transparently.
I am still digging (back) into the RANCID internals to see how easy this would be to accomplish, so just curious if anyone is doing something like this already.
Thanks!
-Aaron
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
heasley
2018-10-06 15:34:06 UTC
Permalink
Post by Ni Ne
I am curious to see the effort behind having the default configuration backup contain only the device configuration, and push other things like file system, interface status, inventory, etc, into a separate file. The main reason is I want to greatly increase the amount of ancillary data retrieved for each device, but don't want to clutter the configuration file itself, so disaster recovery is simpler.
my suggestion is that you do not alter the existing device types in rancid,
leave them as is and collect the additional information as separate device
types in a separate group to avoid the hostname collision.

group1/router.db: host.name.co;cisco;up

group2/router.db: host.name.co;cisco-expanded;up

define cisco-expanded in rancid.type.conf with your own perl module to
do whatever filtering/etc is needed. I think I wrote an example of
this in the FAQ or perhaps in rancid.types.conf(5).
Post by Ni Ne
Is anyone doing this in a stream-lined fashion, where secondary login scripts are called for each device present in a router.db file? Ideally the administrator would only need to add a device once, and then based on vendor type that secondary login process would run transparently.
I am still digging (back) into the RANCID internals to see how easy this would be to accomplish, so just curious if anyone is doing something like this already.
Thanks!
-Aaron
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Piegorsch, Weylin William
2018-10-06 20:41:58 UTC
Permalink
If you want for an administrator to only add a device once, you can create a cron job that periodically (every 5 min? Hourly? Daily?) duplicates the router.db file of one group into a router.db file of a secondary group, using sed or something to convert "cisco" (or whatever) into "cisco-secondary". This would have the benefit of both adding and deleting devices only in one location, since the cron job's function is to maintain the synchronicity.
weylin
Post by Ni Ne
I am curious to see the effort behind having the default configuration backup contain only the device configuration, and push other things like file system, interface status, inventory, etc, into a separate file. The main reason is I want to greatly increase the amount of ancillary data retrieved for each device, but don't want to clutter the configuration file itself, so disaster recovery is simpler.
my suggestion is that you do not alter the existing device types in rancid,
leave them as is and collect the additional information as separate device
types in a separate group to avoid the hostname collision.

group1/router.db: host.name.co;cisco;up

group2/router.db: host.name.co;cisco-expanded;up

define cisco-expanded in rancid.type.conf with your own perl module to
do whatever filtering/etc is needed. I think I wrote an example of
this in the FAQ or perhaps in rancid.types.conf(5).
Post by Ni Ne
Is anyone doing this in a stream-lined fashion, where secondary login scripts are called for each device present in a router.db file? Ideally the administrator would only need to add a device once, and then based on vendor type that secondary login process would run transparently.
I am still digging (back) into the RANCID internals to see how easy this would be to accomplish, so just curious if anyone is doing something like this already.
Thanks!
-Aaron
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Loading...