[rancid] Re: Rancid and Last Config changes in Cisco gear

Nick Duda nduda at VistaPrint.com
Wed Mar 21 12:36:48 UTC 2007

I commented out that line and still don't get the last configured by in
the rancid alerts..etc.

- Nick

-----Original Message-----
From: Mike Ashcraft [mailto:mashcraft at omniture.com] 
Sent: Tuesday, March 20, 2007 4:21 PM
To: Nick Duda; rancid-discuss at shrubbery.net
Subject: RE: [rancid] Rancid and Last Config changes in Cisco gear


In bin/rancid, the following code segment handles this:

# This routine processes a "write term"
sub WriteTerm {
    print STDERR "    In WriteTerm: $_" if ($debug);
    my($lineauto,$comment,$linecnt) = (0,0,0);

    while (<INPUT>) {
        last if(/^$prompt/);
        return(1) if /Line has invalid autocommand /;
        return(1) if /(Invalid input detected|Type help or )/;
        return(-1) if (/command authorization failed/i);
        # the pager can not be disabled per-session on the PIX
        s/^<-+ More -+>\s*//;
        /Non-Volatile memory is in use/  && return(-1); # NvRAM is
        return(0) if ($found_end);              # Only do this routine
        $lineauto = 0 if (/^[^ ]/);
        # skip the crap
        if (/^(##+$|(Building|Current) configuration)/i) {
            while (<INPUT>) {
                next if (/^Current configuration\s*:/i);
                next if (/^:/);
                next if (/^([%!].*|\s*)$/);

The lastline listed above strips out comments and blank lines at the top
of the 'show running configuration' output.  Modify or remove it to
retain your desired information.  You will have to repeat this if you
upgrade rancid.


-----Original Message-----
From: rancid-discuss-bounces at shrubbery.net
[mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Nick Duda
Sent: Tuesday, March 20, 2007 1:13 PM
To: rancid-discuss at shrubbery.net
Subject: [rancid] Rancid and Last Config changes in Cisco gear

Is there any way to add the "Last configuration change" section to
rancid for Cisco gear?

We run rancid, but also have to run a custom script (which prett much
does the exact same thing as rancid) side by side. All it does is give
us the following line:

! ! Last configuration change at 14:58:54 EST Mon Mar 19 2007 by UserX !
! NVRAM config last updated at 14:59:03 EST Mon Mar 19 2007 by UserX

If we could have rancid get this data also (and email it with the
alerts) things would be great.


Rancid-discuss mailing list
Rancid-discuss at shrubbery.net

More information about the Rancid-discuss mailing list