[rancid] comparing device running config against startup config

Per-Olof Olsson peo at chalmers.se
Wed Sep 21 06:15:38 UTC 2011


Correct command for HP procurv is "show config status".

Have only done some test on HP but we have to many 2650's then.
No there less 2650's so I have to consider if we start using it.

stats/38-> diff -c /usr/local/rancid/bin/hrancid hrancid
*** /usr/local/rancid/bin/hrancid       Wed Jan 26 11:30:26 2011
--- hrancid     Wed Sep 21 08:03:21 2011
***************
*** 320,325 ****
--- 320,344 ----
       return(0);
   }

+ # This routine parses "show config status"
+ sub ShowConfigStatus {
+     print STDERR "    In ShowConfigStatus: $_" if ($debug);
+
+     while (<INPUT>) {
+       tr/\015//d;
+       last if (/^$prompt/);
+       next if (/^(\s*|\s*$cmd\s*)$/);
+       return(-1) if (/command authorization failed/i);
+       return(1) if /^(Invalid|Ambiguous) input:/i;
+       next if (/^Running configuration is same as the startup configuration.\s*$/);
+
+       $now = localtime;
+       ProcessHistory("COMMENTS","keysort","H0",";$now $_");
+
+     }
+     return(0);
+ }
+

   # This routine processes a "write term"
   sub WriteTerm {
***************
*** 515,520 ****
--- 534,540 ----
         {'show stack'                   => 'ShowStack'},
         {'show tech transceivers'       => 'ShowTransceivers'},
         {'show config files'            => 'ShowConfigFiles'},
+       {'show config status'           => 'ShowConfigStatus'},
         {'write term'                   => 'WriteTerm'}
   );
   # Use an array to preserve the order of the commands and a hash for mapping
---end of diff-----------------------


If you don't like "spaming mode" just comment "$now = localtime;" line.



/Peo
----------------------------------------------------------
Per-Olof Olsson               Email: peo at chalmers.se
Chalmers tekniska högskola    IT-service
Hörsalsvägen 5                412 96 Göteborg
Tel: 031/772 6738  Fax: 031/772 8660
----------------------------------------------------------


Per-Olof Olsson wrote:
> Ian Stong skrev 2011-09-20 16:10:
>> We are using rancid to grab the running config and look for differences
>> over the previous running config. That works great and as advertised. I
>> was wondering what others are doing to catch the occasional issue where
>> someone makes a change to the running config but for whatever reason it
>> doesn't get saved and the device crashes - hence loosing that part of
>> the config.
>>
>> What suggestions do you have for ensuring the running config matches the
>> startup config?
>>
> Thinks there begin to be useful info for some platforms.
> 
> HP procurve have on later switches "show running-config status"
> Not fully working on 2650! After reboot it always differ.
> HP support have fixed this for 2610's after I bug report it.
> 
> 
> Cisco IOS. Compare time stamp  from "show running-config"
> Some of the first lines.
> 
> 
> Nexus. Look at output from  "show running-config diff".
> Can't test latest version if it still generate diffs for some lines.
> 
> 
>> Thanks,
>>
>> Ian
>> _______________________________________________
>> Rancid-discuss mailing list
>> Rancid-discuss at shrubbery.net
>> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
> 
> 
> /Peo
> ----------------------------------------------------------
> Per-Olof Olsson               Email: peo at chalmers.se
> Chalmers tekniska högskola    IT-service
> Hörsalsvägen 5                412 96 Göteborg
> Tel: 031/772 6738  Fax: 031/772 8680
> ----------------------------------------------------------
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss




More information about the Rancid-discuss mailing list