[rancid] comparing device running config against startup config

Lee ler762 at gmail.com
Sun Oct 16 16:57:20 UTC 2011


On 9/20/11, Ian Stong <istong at costar.com> wrote:
> 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?

If you have SNMP enabled on your devices:

cat ${DEVLIST} | while read DEV trash
do

  chgTime=`snmpget -Le -OqUtv $DEV
CISCO-CONFIG-MAN-MIB::ccmHistoryRunningLastChanged.0 `
  savTime=`snmpget -Le -OqUtv $DEV
CISCO-CONFIG-MAN-MIB::ccmHistoryStartupLastChanged.0 `

  if [ $savTime -lt $chgTime ]; then
     printf "%-14s config needs to be saved %s %s\n"  $DEV $chgTime  $savTime
  fi

done


Then you can use CISCO-CONFIG-COPY-MIB to do the equivalent of 'copy
run start' or generate & run a 'clogin -c "copy run start" router1 ...
routerN' shell script

Regards,
Lee


More information about the Rancid-discuss mailing list