[rancid] Re: Rancid and Last Config changes in Cisco gear
Mike Ashcraft
mashcraft at omniture.com
Tue Mar 20 20:20:31 UTC 2007
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
More information about the Rancid-discuss
mailing list