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

Nick Duda nduda at VistaPrint.com
Wed Mar 21 12:43:01 UTC 2007


FYI, so this is what my rancid file looks like:


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

    while (<INPUT>) {
        tr/\015//d;
        last if(/^$prompt/);
        return(-1) if (/command authorization failed/i);
        return(1) if /(Invalid input detected|Type help or )/;
        # the pager can not be disabled per-session on the PIX
        s/^<-+ More -+>\s*//;
        /Non-Volatile memory is in use/  && return(-1); # NvRAM is
locked
        return(0) if ($found_end);              # Only do this routine
once
        $linecnt++;
        $lineauto = 0 if (/^[^ ]/);
        # skip the crap
        if (/^(##+$|(Building|Current) configuration)/i) {
            while (<INPUT>) {
                next if (/^Current configuration\s*:/i);
                next if (/^:/);
#               next if (/^([%!].*|\s*)$/);
                next if (/^ip add.*ipv4:/);     # band-aid for 3620
12.0S
                last;
            }

-----Original Message-----
From: rancid-discuss-bounces at shrubbery.net
[mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Nick Duda
Sent: Wednesday, March 21, 2007 8:37 AM
To: Mike Ashcraft; rancid-discuss at shrubbery.net
Subject: [rancid] Re: Rancid and Last Config changes in Cisco gear

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

Nick,

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>) {
        tr/\015//d;
        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
locked
        return(0) if ($found_end);              # Only do this routine
once
        $linecnt++;
        $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.

Mike
 

-----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.

Regards,
Nick  

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
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