[rancid] stopping command from being run

Charles T. Brooks Charles.Brooks at hbcs.org
Mon Jun 25 14:45:48 UTC 2018


Hi Mike.  I am running 3.7 also, in my case on RHEL7 with git.  I am very happy with it.

As I understand it, editing the perl modules to try to change commands issued to devices is a very wrong approach; it means you can't easily upgrade and your installation will be weird and difficult to get advice for online.  so I strongly recommend you carefully revert any such changes you made.

The files rancid.types.base (base types, do not edit) and rancid.types.conf (site custom device types) determine what commands are run for specific devices.

So for example: on my Cisco Nexus 9Ks, I did not want to run the "show logflash" command, so I copied the "cisco-nx" device type from /etc/rancid/rancid.types.base to /etc/rancid/rancid.types.conf under the new device type name "cisco-nx9k" and removed the command I did not want.

This is how I did it, if you are OK with old-school unixisms...

cd /etc/rancid
gawk 'BEGIN{FS=";";OFS=FS;printf "\n# Same as cisco-nx from /etc/rancid/rancid.types.base but\n# removing troublesome dir logflash command\n\n"};/dir logflash:$/{next};/^cisco-nx/{gsub(/cisco-nx/,"cisco-nx9k");print}'  rancid.types.base >>rancid.types.conf

If you're not gawky :) I recommend you do it by hand instead of the way I did it.  (Mad props to the maintainer of the FSF's GNU awk, Aharon Robbins!)

Once you've defined the new device type, in your router.db file you use the newly defined name instead of cisco-nx and you're all set.

--Charlie

________________________________________
From: Rancid-discuss [rancid-discuss-bounces at shrubbery.net] on behalf of Michael T. Voity [mvoity at uvm.edu]
Sent: Monday, June 25, 2018 10:10 AM
To: rancid-discuss at shrubbery.net
Subject: Re: [rancid] stopping command from being run

Hello,

Anyone have an idea that they can point me in a direction?

Thanks,

-Mike


--
Michael T. Voity
Network Engineer
University of Vermont


From: Rancid-discuss <rancid-discuss-bounces at shrubbery.net> On Behalf Of Michael T. Voity
Sent: Friday, June 22, 2018 12:05 PM
To: rancid-discuss at shrubbery.net
Subject: [rancid] stopping command from being run

Hello,

We are running 3.7

I seem to be having difficulty in getting the command “show dir /all” to stop be executed with my nexus switches.

I have edited the  ‘nxrancid’  and the ‘nxos.pm’  without success.

Ideas?

-Mike

--
------------------  CONFIDENTIALITY NOTICE  ---------------

  This message, including any attachments, is for the sole use of the
intended recipient(s) and may contain privileged confidential information
protected by law. Any unauthorized review, use, disclosure or distribution
of this message is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this message.
 
     ------------------  CONFIDENTIALITY NOTICE  ---------------



More information about the Rancid-discuss mailing list