<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>TomsBlog</title>
    <link>http://www.toms-blog.com/tags/rancid/index.xml</link>
    <description>Recent content on TomsBlog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-uk</language>
    <atom:link href="http://www.toms-blog.com/tags/rancid/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Backup Cisco config with Rancid and an unprivileged user</title>
      <link>http://www.toms-blog.com/post/backup-cisco-config-with-rancid-with-unprivileged-user/</link>
      <pubDate>Thu, 24 Jan 2013 22:35:43 +0000</pubDate>
      
      <guid>http://www.toms-blog.com/post/backup-cisco-config-with-rancid-with-unprivileged-user/</guid>
      <description>&lt;p&gt;RANCID is a tool for backing up network devices configuration and versioning the backups. It was originally intended to backup Cisco configurations it does this by logging in to the devices using either telnet or ssh and then runs a series of commands. In a default set up it runs multiple commands and captures the output of each command, we don’t need all this information infact we only want to store the configuration and so we only need to grant the user one command “show running-config”.&lt;/p&gt;

&lt;p&gt;You need to have RANCID already set up and be familiar with how it works. You can find a useful guide here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://openmaniak.com/rancid_tutorial.php&#34;&gt;http://openmaniak.com/rancid_tutorial.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ll explain how the configuration file determines what scripts are run. Lets take the following router.db configuration:&lt;/p&gt;

&lt;div class=&#34;box&#34;&gt;
&lt;p&gt;192.168.0.1:cisco:up&lt;/p&gt;

&lt;p&gt;192.168.0.2:cisco:up&lt;/p&gt;

&lt;/div&gt;

&lt;p&gt;The first part is the IP address or hostname of the device then the type of device and weather it is up or down. This device type actually specifies what scripts to run, this mapping can be found in the file “rancid-fe” which is by default stored in /usr/libexec/rancid/. Open up the file and we are looking for the vendortable  array:&lt;/p&gt;

&lt;div class=&#34;highlight&#34; style=&#34;background: #f0f3f3&#34;&gt;&lt;pre style=&#34;line-height: 125%&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&#34;color: #003333&#34;&gt;%vendortable&lt;/span&gt; &lt;span style=&#34;color: #555555&#34;&gt;=&lt;/span&gt; (
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;agm&amp;#39;&lt;/span&gt;               &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;agmrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;alteon&amp;#39;&lt;/span&gt;            &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;arancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;arista&amp;#39;&lt;/span&gt;            &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;arrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;avocent&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;avorancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;baynet&amp;#39;&lt;/span&gt;            &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;brancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;cat5&amp;#39;&lt;/span&gt;              &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;cat5rancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;cisco&amp;#39;&lt;/span&gt;             &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;rancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;cisco-old&amp;#39;&lt;/span&gt;         &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;rancid-old&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;cisco-nx&amp;#39;&lt;/span&gt;          &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;nxrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;cisco-xr&amp;#39;&lt;/span&gt;          &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;xrrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;css&amp;#39;&lt;/span&gt;               &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;cssrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;enterasys&amp;#39;&lt;/span&gt;         &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;rivrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;erx&amp;#39;&lt;/span&gt;               &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;jerancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;extreme&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;xrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;ezt3&amp;#39;&lt;/span&gt;              &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;erancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;f5-file&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;f5ranciducs&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;force10&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;f10rancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;fortigate&amp;#39;&lt;/span&gt;         &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;fnrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;foundry&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;francid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;hitachi&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;htrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;hp&amp;#39;&lt;/span&gt;                &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;hrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;juniper&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;jrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;mrtd&amp;#39;&lt;/span&gt;              &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;mrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;mrv&amp;#39;&lt;/span&gt;               &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;mrvrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;netopia&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;trancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;netscaler&amp;#39;&lt;/span&gt;         &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;nsrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;netscreen&amp;#39;&lt;/span&gt;         &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;nrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;procket&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;prancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;redback&amp;#39;&lt;/span&gt;           &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;rrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;riverstone&amp;#39;&lt;/span&gt;        &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;rivrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;smc&amp;#39;&lt;/span&gt;               &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;srancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;tnt&amp;#39;&lt;/span&gt;               &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;tntrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;zebra&amp;#39;&lt;/span&gt;             &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;zrancid&amp;#39;&lt;/span&gt;,
    &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;watchguard&amp;#39;&lt;/span&gt;        &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;wrancid&amp;#39;&lt;/span&gt;
)
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;As you can see cisco maps to the “rancid” script file. So lets copy that script file and call it “rancid.bak”, this is so we can restore the file later if we wish.&lt;/p&gt;

&lt;p&gt;Now edit the rancid file using you favourite editor and find the commandtable array “@commandtable”, comment out this entire array:&lt;/p&gt;

&lt;p&gt;&lt;div class=&#34;highlight&#34; style=&#34;background: #f0f3f3&#34;&gt;&lt;pre style=&#34;line-height: 125%&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#@commandtable = (&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show version&amp;#39;                 =&amp;gt; &amp;#39;ShowVersion&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show redundancy secondary&amp;#39;    =&amp;gt; &amp;#39;ShowRedundancy&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show idprom backplane&amp;#39;,       =&amp;gt; &amp;#39;ShowIDprom&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show install active&amp;#39;          =&amp;gt; &amp;#39;ShowInstallActive&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show env all&amp;#39;                 =&amp;gt; &amp;#39;ShowEnv&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show rsp chassis-info&amp;#39;,       =&amp;gt; &amp;#39;ShowRSP&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show gsr chassis&amp;#39;             =&amp;gt; &amp;#39;ShowGSR&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show diag chassis-info&amp;#39;       =&amp;gt; &amp;#39;ShowGSR&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show boot&amp;#39;                    =&amp;gt; &amp;#39;ShowBoot&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show bootvar&amp;#39;                 =&amp;gt; &amp;#39;ShowBoot&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show variables boot&amp;#39;          =&amp;gt; &amp;#39;ShowBoot&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show flash&amp;#39;                   =&amp;gt; &amp;#39;ShowFlash&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all nvram:&amp;#39;              =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all bootflash:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slot0:&amp;#39;              =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all disk0:&amp;#39;              =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slot1:&amp;#39;              =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all disk1:&amp;#39;              =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slot2:&amp;#39;              =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all disk2:&amp;#39;              =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all harddisk:&amp;#39;           =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all harddiska:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all harddiskb:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sup-bootflash:&amp;#39;      =&amp;gt; &amp;#39;DirSlotN&amp;#39;},         # cat 6500-ios&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sup-microcode:&amp;#39;      =&amp;gt; &amp;#39;DirSlotN&amp;#39;},         # cat 6500-ios&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slavenvram:&amp;#39;         =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slavebootflash:&amp;#39;     =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slaveslot0:&amp;#39;         =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slavedisk0:&amp;#39;         =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slaveslot1:&amp;#39;         =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slavedisk1:&amp;#39;         =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slaveslot2:&amp;#39;         =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slavedisk2:&amp;#39;         =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all slavesup-bootflash:&amp;#39; =&amp;gt; &amp;#39;DirSlotN&amp;#39;},         # cat 7609&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-nvram:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-bootflash:&amp;#39;      =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-slot0:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-disk0:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-slot1:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-disk1:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-slot2:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;dir /all sec-disk2:&amp;#39;          =&amp;gt; &amp;#39;DirSlotN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show controllers&amp;#39;             =&amp;gt; &amp;#39;ShowContAll&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show controllers cbus&amp;#39;        =&amp;gt; &amp;#39;ShowContCbus&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show diagbus&amp;#39;                 =&amp;gt; &amp;#39;ShowDiagbus&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show diag&amp;#39;                    =&amp;gt; &amp;#39;ShowDiag&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show module&amp;#39;                  =&amp;gt; &amp;#39;ShowModule&amp;#39;},       # cat 6500-ios&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show spe version&amp;#39;             =&amp;gt; &amp;#39;ShowSpeVersion&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show c7200&amp;#39;                   =&amp;gt; &amp;#39;ShowC7200&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show inventory raw&amp;#39;           =&amp;gt; &amp;#39;ShowInventory&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show vtp status&amp;#39;              =&amp;gt; &amp;#39;ShowVTP&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show vlan&amp;#39;                    =&amp;gt; &amp;#39;ShowVLAN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show vlan-switch&amp;#39;             =&amp;gt; &amp;#39;ShowVLAN&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show debug&amp;#39;                   =&amp;gt; &amp;#39;ShowDebug&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;more system:running-config&amp;#39;   =&amp;gt; &amp;#39;WriteTerm&amp;#39;},        # ASA/PIX&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;show running-config&amp;#39;          =&amp;gt; &amp;#39;WriteTerm&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#       {&amp;#39;write term&amp;#39;                   =&amp;gt; &amp;#39;WriteTerm&amp;#39;},&lt;/span&gt;
&lt;span style=&#34;color: #0099FF; font-style: italic&#34;&gt;#);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt;Now we need to create the array again but with our command:&lt;/p&gt;

&lt;p&gt;&lt;div class=&#34;highlight&#34; style=&#34;background: #f0f3f3&#34;&gt;&lt;pre style=&#34;line-height: 125%&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&#34;color: #003333&#34;&gt;@commandtable&lt;/span&gt; &lt;span style=&#34;color: #555555&#34;&gt;=&lt;/span&gt; {
{&lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;show running-config view full&amp;#39;&lt;/span&gt; &lt;span style=&#34;color: #555555&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&#34;color: #CC3300&#34;&gt;&amp;#39;WriteTerm&amp;#39;&lt;/span&gt;}
);
&lt;/pre&gt;&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt;This basically maps the command “show running-config view full” to the function “WriteTerm”, so when run it will connect to the device run the command and then the function will parse the output and remove certain things like password etc and then save the output to host.new where host is the name of the host.&lt;/p&gt;

&lt;p&gt;Now all we need to do is set up a user on the switch so connect to the switch:&lt;/p&gt;

&lt;div class=&#34;highlight&#34; style=&#34;background: #f0f3f3&#34;&gt;&lt;pre style=&#34;line-height: 125%&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&#34;color: #336666&#34;&gt;enable&lt;/span&gt;
conf t
username rancid privilege &lt;span style=&#34;color: #FF6600&#34;&gt;4&lt;/span&gt; secret password
privilege &lt;span style=&#34;color: #336666&#34;&gt;exec&lt;/span&gt; level &lt;span style=&#34;color: #FF6600&#34;&gt;4&lt;/span&gt; show running-config view full
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This creates a user called rancid and password “password” and grants it privilege 4. The last command then allows level 4 to run the command  “show the running config”.&lt;/p&gt;

&lt;p&gt;Now add the username and password to your .clogin&lt;/p&gt;

&lt;div class=&#34;box&#34;&gt;
&lt;p&gt;add user * rancid&lt;/p&gt;

&lt;p&gt;add password * password&lt;/p&gt;

&lt;p&gt;add method * {ssh} {telnet}&lt;/p&gt;

&lt;p&gt;add autoenable * {[01]}&lt;/p&gt;

&lt;/div&gt;

&lt;p&gt;This means rancid will use the rancid username and password for all devices, it will first try SSH but if that fails it will then try Telnet. The last line means it doesnt need to run enable on login, adjust this to your needs.&lt;/p&gt;

&lt;p&gt;This unfortunately doesn’t work on all IOS’s versions, you can also use TACACs to limit a users access to the device and is the preferred way, but if you don’t have TACACs and have the latest IOS the above will work just fine. You can also add a section to the “rancid-fe” file that points “cisco-old” for example to the original script file that we backed up previously then you can run the old and new cisco script as and when you need to.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>