From srau at rauhaus.org Wed Jul 7 17:57:17 2004 From: srau at rauhaus.org (Stafford A. Rau) Date: Wed, 7 Jul 2004 10:57:17 -0700 Subject: Routers changed to down: after upgrade Message-ID: <20040707175717.GB1562@rauhaus.org> I recently upgraded our rancid installation to version 2.3.1 from 2.2.somthing, and have an odd little issue. I get a blank "Routers changed to down:" message every run for each group that doesn't have any routers in the down state. If I add something like "junk:cisco:down" to each group's router.db, then I don't get any further "Routers changed to down:" messages after the next run that reports the "junk" one. Any suggestions? I can, of course, leave the junk line in my router.db files, but that's not very aesthetically pleasing. --Stafford From rrm at callwave.com Thu Jul 8 17:55:07 2004 From: rrm at callwave.com (Mazlumyan, Rafi) Date: Thu, 08 Jul 2004 10:55:07 -0700 Subject: seq number in cisco prefix-list Message-ID: <1388870000.1089309307@dhcp-dlv-185.callwave.com> Any reason why seq number in prefix-list is stipped out ? I changed my copy of rancid to include the seq number. I'm wondering what the reasoning behind the removal was. $ diff rancid rancid.orig 995c995 < ProcessHistory("PACL $1 $3","ipsort","$4","ip prefix-list $1 seq $2 $3 $4$5\n") --- > ProcessHistory("PACL $1 $3","ipsort","$4","ip prefix-list $1 $3 $4$5\n") Thanks, Rafi. From asp at partan.com Fri Jul 9 01:20:02 2004 From: asp at partan.com (Andrew Partan) Date: Thu, 8 Jul 2004 21:20:02 -0400 Subject: seq number in cisco prefix-list In-Reply-To: <1388870000.1089309307@dhcp-dlv-185.callwave.com> References: <1388870000.1089309307@dhcp-dlv-185.callwave.com> Message-ID: <20040709012002.GA49090@partan.com> On Thu, Jul 08, 2004 at 10:55:07AM -0700, Mazlumyan, Rafi wrote: > Any reason why seq number in prefix-list is stipped out ? Say you have a 101 line prefix-list & you add a new entry as the 1st entry. The prefix-list gets renumbered, and, if rancid kept the seq number, then the diff would be the entire list. We deleted the seq number so that the diff would be just the one new line. --asp From yuvalba at netvision.net.il Fri Jul 9 14:58:06 2004 From: yuvalba at netvision.net.il (Yuval Ben-Ari) Date: Fri, 9 Jul 2004 16:58:06 +0200 Subject: seq number in cisco prefix-list Message-ID: I also find it undesired and also disabled it. this makes the rancid config be different from the router config forgive my ignorance but what renumbering are you refering to ? Router(config)#ip prefix-list TEST permit 10.0.0.0/8 Router(config)#ip prefix-list TEST permit 20.0.0.0/8 Router(config)#ip prefix-list TEST permit 30.0.0.0/8 Router(config)# Router(config)#do sh ip prefix-list TEST ip prefix-list TEST: 3 entries seq 5 permit 10.0.0.0/8 seq 10 permit 20.0.0.0/8 seq 15 permit 30.0.0.0/8 Router(config)#ip prefix-list TEST seq 1 permit 5.0.0.0/8 Router(config)#do sh ip prefix-list TEST ip prefix-list TEST: 4 entries seq 1 permit 5.0.0.0/8 seq 5 permit 10.0.0.0/8 seq 10 permit 20.0.0.0/8 seq 15 permit 30.0.0.0/8 Router(config)# > -----Original Message----- > From: owner-rancid-discuss at shrubbery.net > [mailto:owner-rancid-discuss at shrubbery.net] On Behalf Of Andrew Partan > Sent: Friday, July 09, 2004 03:20 > To: Mazlumyan, Rafi > Cc: rancid-discuss at shrubbery.net > Subject: Re: seq number in cisco prefix-list > > > On Thu, Jul 08, 2004 at 10:55:07AM -0700, Mazlumyan, Rafi wrote: > > Any reason why seq number in prefix-list is stipped out ? > > Say you have a 101 line prefix-list & you add a new entry as the > 1st entry. The prefix-list gets renumbered, and, if rancid kept > the seq number, then the diff would be the entire list. We deleted > the seq number so that the diff would be just the one new line. > --asp > From jejs+rancid at sahala.org Fri Jul 9 14:26:38 2004 From: jejs+rancid at sahala.org (joshua sahala) Date: Fri, 9 Jul 2004 10:26:38 -0400 Subject: seq number in cisco prefix-list In-Reply-To: References: Message-ID: <20040709142638.GC6100@aurvandil.sahala.org> On (09/07/04 16:58), Yuval Ben-Ari wrote: > > I also find it undesired and also disabled it. > this makes the rancid config be different from the router config > > forgive my ignorance but what renumbering are you refering to ? > > Router(config)#do sh ip prefix-list TEST > ip prefix-list TEST: 4 entries > seq 1 permit 5.0.0.0/8 > seq 5 permit 10.0.0.0/8 > seq 10 permit 20.0.0.0/8 > seq 15 permit 30.0.0.0/8 > Router(config)# > when you insert a rule between/before an existing rule, then the sequence numbers of the rules don't change...but if you renumber so that the rules are always 5 apart, then a portion of the list would change (this is likely the case for people who automagically generate their filters) ex: seq 5 permit 10.0.0.0/8 seq 10 permit 20.0.0.0/8 seq 15 permit 30.0.0.0/8 becomes: seq 5 permit 2.0.0.0/8 seq 10 permit 10.0.0.0/8 seq 15 permit 20.0.0.0/8 seq 20 permit 30.0.0.0/8 so in this case rancid will send you a longer list of changes (since technically the entire prefix list changed) /joshua -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. - Douglas Adams - From yuvalba at netvision.net.il Sat Jul 10 20:55:22 2004 From: yuvalba at netvision.net.il (Yuval Ben-Ari) Date: Sat, 10 Jul 2004 22:55:22 +0200 Subject: seq number in cisco prefix-list Message-ID: > when you insert a rule between/before an existing rule, then the > sequence numbers of the rules don't change...but if you renumber so > that the rules are always 5 apart, then a portion of the list would > change (this is likely the case for people who automagically generate > their filters) > ex: > seq 5 permit 10.0.0.0/8 > seq 10 permit 20.0.0.0/8 > seq 15 permit 30.0.0.0/8 > becomes: > seq 5 permit 2.0.0.0/8 > seq 10 permit 10.0.0.0/8 > seq 15 permit 20.0.0.0/8 > seq 20 permit 30.0.0.0/8 > so in this case rancid will send you a longer list of changes (since > technically the entire prefix list changed) I see, we do it manually so no change in sequencing. I think it will be useful to have this as a configurable behavior in future release > /joshua > -- > From rrm at callwave.com Sat Jul 10 21:34:58 2004 From: rrm at callwave.com (Mazlumyan, Rafi) Date: Sat, 10 Jul 2004 14:34:58 -0700 Subject: seq number in cisco prefix-list In-Reply-To: References: Message-ID: <1750990000.1089495298@dhcp-dlv-185.callwave.com> --On Saturday, July 10, 2004 10:55:22 PM +0200 Yuval Ben-Ari wrote: >> when you insert a rule between/before an existing rule, then the >> sequence numbers of the rules don't change...but if you renumber so >> that the rules are always 5 apart, then a portion of the list would >> change (this is likely the case for people who automagically generate >> their filters) >> ex: >> seq 5 permit 10.0.0.0/8 >> seq 10 permit 20.0.0.0/8 >> seq 15 permit 30.0.0.0/8 >> becomes: >> seq 5 permit 2.0.0.0/8 >> seq 10 permit 10.0.0.0/8 >> seq 15 permit 20.0.0.0/8 >> seq 20 permit 30.0.0.0/8 >> so in this case rancid will send you a longer list of changes (since >> technically the entire prefix list changed) > > I see, we do it manually so no change in sequencing. > I think it will be useful to have this as a configurable behavior in > future release > I second that request. We also do it manually. Cheers, Rafi. From browan at nocinthebox.com Fri Jul 9 16:06:06 2004 From: browan at nocinthebox.com (Bill Rowan) Date: Fri, 9 Jul 2004 11:06:06 -0500 Subject: Routers changed to down: after upgrade Message-ID: <20040712210337.179B111139@guelah.shrubbery.net> We are seeing this exact same problem after upgrading from 2.3.1 to 2.2.2. We are running RANCID for multiple cities, but not seeing this empty "down" message on all of our cities. Has anyone else seen and/or have a fix for this? -----Original Message----- From: owner-rancid-discuss at shrubbery.net [mailto:owner-rancid-discuss at shrubbery.net]On Behalf Of Stafford A. Rau Sent: Wednesday, July 07, 2004 12:57 PM To: rancid-discuss at shrubbery.net Subject: Routers changed to down: after upgrade I recently upgraded our rancid installation to version 2.3.1 from 2.2.somthing, and have an odd little issue. I get a blank "Routers changed to down:" message every run for each group that doesn't have any routers in the down state. If I add something like "junk:cisco:down" to each group's router.db, then I don't get any further "Routers changed to down:" messages after the next run that reports the "junk" one. Any suggestions? I can, of course, leave the junk line in my router.db files, but that's not very aesthetically pleasing. --Stafford From heas at shrubbery.net Fri Jul 16 15:48:45 2004 From: heas at shrubbery.net (john heasley) Date: Fri, 16 Jul 2004 08:48:45 -0700 Subject: Routers changed to down: after upgrade In-Reply-To: <20040712210337.179B111139@guelah.shrubbery.net> <20040707175717.GB1562@rauhaus.org> References: <20040712210337.179B111139@guelah.shrubbery.net> <20040707175717.GB1562@rauhaus.org> Message-ID: <20040716154845.GI8529@shrubbery.net> Wed, Jul 07, 2004 at 10:57:17AM -0700, Stafford A. Rau: > I recently upgraded our rancid installation to version 2.3.1 from > 2.2.somthing, and have an odd little issue. > > I get a blank "Routers changed to down:" message every run for each > group that doesn't have any routers in the down state. If I add > something like "junk:cisco:down" to each group's router.db, then I don't > get any further "Routers changed to down:" messages after the next run > that reports the "junk" one. > > Any suggestions? I can, of course, leave the junk line in my router.db > files, but that's not very aesthetically pleasing. > > --Stafford Fri, Jul 09, 2004 at 11:06:06AM -0500, Bill Rowan: > We are seeing this exact same problem after upgrading from 2.3.1 to 2.2.2. We are running RANCID for multiple cities, but not > seeing this empty "down" message on all of our cities. Has anyone else seen and/or have a fix for this? I suspect that you're both using solaris and the PATH that is in rancid.conf is causing control_rancid to pick-up a diff(1) that does not support -u. you can adjust the PATH or try reinstalling with this patch for autoconf: ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.1.p1 From srau at rauhaus.org Tue Jul 20 17:22:16 2004 From: srau at rauhaus.org (Stafford A. Rau) Date: Tue, 20 Jul 2004 10:22:16 -0700 Subject: Routers changed to down: after upgrade In-Reply-To: <20040716154845.GI8529@shrubbery.net> References: <20040712210337.179B111139@guelah.shrubbery.net> <20040707175717.GB1562@rauhaus.org> <20040716154845.GI8529@shrubbery.net> Message-ID: <20040720172215.GA21167@rauhaus.org> * john heasley [040716 08:48]: > > I suspect that you're both using solaris and the PATH that is in rancid.conf > is causing control_rancid to pick-up a diff(1) that does not support -u. > > you can adjust the PATH or try reinstalling with this patch for autoconf: > > ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.1.p1 Changing the PATH in rancid.conf so that GNU diff gets picked up first rather than Solaris diff seems to have done the trick. Thanks much (again), --Stafford From ttauber at 1-4-5.net Thu Jul 22 18:20:22 2004 From: ttauber at 1-4-5.net (Tony Tauber) Date: Thu, 22 Jul 2004 11:20:22 -0700 (PDT) Subject: Nortel Passport Message-ID: Hi all, I'm finally making use of this fine tool. I needed to be able to collect configs from Nortel Passport switches and found some discussion in the archives about this topic but nothing definitive. We also have a few Nortel Bay routers for which blogin and brancid work fine. I found I had to make the following modifications for Passports: copy blogin and brancid to passlogin and passrancid, respectively. Diffs of these files are at the bottom but the changes are: In passlogin, - disable paging with "config cli more false". In passrancid, - change the commands to ones that work for Passports - fix the logic which searches for the end of file to look for a line beginning with the word "back" - fix internal references to "blogin" to say "passlogin" - look for prompts ending in "#" rather than ">" (I don't know this gear so well, these prompts may be specific to our deployment.) In rancid-fe, add this line for the new device type: elsif ($vendor =~ /^passport$/i) { exec('passrancid', $router); } Hope this info can help others. Sorry if it has actually been covered before. Don't know if it makes sense to include in a future rev. of the tool. Tony diff blogin passlogin 440c440,441 < send "more off\r" --- > #send "more off\r" > send "config cli more false\r" 492,493c493 < #set prompt "#" < set prompt ">" --- > set prompt "#" 499,500c499 < #set prompt "#" < set prompt ">" --- > set prompt "#" 610c609,610 < send "more off\r" --- > #send "more off\r" > send "config cli more false\r" 3c3 diff brancid passrancid 35c35 < $timeo = 90; # blogin timeout in seconds --- > $timeo = 90; # passlogin timeout in seconds 142d141 < 156a156,161 > if (/^(exit|back)$/) { > #if (/^exit$/) { > $found_end = 1; > ProcessHistory("","","","$_"); > return(1); > } 160,163d164 < if (/exit$/) { < $found_end = 1; < return(1); < } 190,193c191 < 'bcc' => "RunCommand", < 'show config' => "ShowConfig", < 'show config -all' => "ShowConfig", < 'exit' => "RunCommand" --- > 'show config' => "ShowConfig" 198,201c196 < "bcc", < "show config", < "show config -all", < "exit" --- > "show config" 216,217c211,212 < print STDERR "executing blogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug); < print STDOUT "executing blogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log); --- > print STDERR "executing passlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug); > print STDOUT "executing passlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log); 219,220c214,215 < system "blogin -t $timeo -c \"$cisco_cmds\" $host $host.raw 2>&1" || die "blogin failed for $host: $!\n"; < open(INPUT, "< $host.raw") || die "blogin failed for $host: $!\n"; --- > system "passlogin -t $timeo -c \"$cisco_cmds\" $host $host.raw 2>&1" || die "passlogin failed for $host: $!\n"; > open(INPUT, "< $host.raw") || die "passlogin failed for $host: $!\n"; 222c217 < open(INPUT,"blogin -t $timeo -c \"$cisco_cmds\" $host open(INPUT,"passlogin -t $timeo -c \"$cisco_cmds\" $host \s?logout$/) || $found_end ) { --- > if ( (/\#\s?logout$/) || $found_end ) { 243,244c238,239 < print STDOUT ("$host blogin error: $_"); < print STDERR ("$host blogin error: $_") if ($debug); --- > print STDOUT ("$host passlogin error: $_"); > print STDERR ("$host passlogin error: $_") if ($debug); 248c243 < while (/>\s*($cmds_regexp)\s*$/) { --- > while (/#\s*($cmds_regexp)\s*$/) { 251c246 < $prompt = ($_ =~ /^([^>]+>)/)[0]; --- > $prompt = ($_ =~ /^([^#]+#)/)[0]; From yuvalba at netvision.net.il Fri Jul 23 10:49:32 2004 From: yuvalba at netvision.net.il (Yuval Ben-Ari) Date: Fri, 23 Jul 2004 12:49:32 +0200 Subject: 3550 - 12.1(22)EA1 - multiple-fs Message-ID: Hi, Recently upgraded a 3550 to 12.1(22)EA1 and I see new file in the flash called "multiple-fs" which causes config oscillation. Any idea what it's for, and how to stop it from causing changes (beside filtering the line) ? @@ -27,12 +27,12 @@ !Variable: buffer size: 393216 ! !Flash: Directory of flash:/ !Flash: 2 -rwx 314 Mar 01 1993 03:12:34 +03:00 system_env_vars - !Flash: 3 -rwx 1048 Jul 23 2004 06:30:15 +03:00 multiple-fs !Flash: 4 -rwx 4950964 Mar 01 1993 03:10:55 +03:00 c3550-i5k2l2q3-mz.121-22.EA1.bin !Flash: 5 -rwx 0 Mar 01 1993 03:12:34 +03:00 env_vars !Flash: 8 drwx 192 Mar 01 1993 03:05:03 +03:00 c3550-i5q3l2-mz.121-19.EA1c + !Flash: 88 -rwx 1048 Jul 23 2004 12:30:18 +03:00 multiple-fs !Flash: 16128000 bytes total (4003840 bytes free) ! ! !VTP: VTP Version : 2 From heas at shrubbery.net Fri Jul 23 17:39:35 2004 From: heas at shrubbery.net (john heasley) Date: Fri, 23 Jul 2004 10:39:35 -0700 Subject: 3550 - 12.1(22)EA1 - multiple-fs In-Reply-To: References: Message-ID: <20040723173935.GB10726@shrubbery.net> Fri, Jul 23, 2004 at 12:49:32PM +0200, Yuval Ben-Ari: > > Hi, > > Recently upgraded a 3550 to 12.1(22)EA1 and I see new file in the flash > called "multiple-fs" which causes config oscillation. > Any idea what it's for, and how to stop it from causing changes (beside > filtering the line) ? can you 'more' the file? i dont know what it is. does the size change or just the date? asp, can we re-visit the time/space filtering? maybe we can come up with some regexes to make file names that we want unfiltered and filter the time and size from the remaining. > > @@ -27,12 +27,12 @@ > !Variable: buffer size: 393216 > ! > !Flash: Directory of flash:/ > !Flash: 2 -rwx 314 Mar 01 1993 03:12:34 +03:00 > system_env_vars > - !Flash: 3 -rwx 1048 Jul 23 2004 06:30:15 +03:00 > multiple-fs > !Flash: 4 -rwx 4950964 Mar 01 1993 03:10:55 +03:00 > c3550-i5k2l2q3-mz.121-22.EA1.bin > !Flash: 5 -rwx 0 Mar 01 1993 03:12:34 +03:00 env_vars > !Flash: 8 drwx 192 Mar 01 1993 03:05:03 +03:00 > c3550-i5q3l2-mz.121-19.EA1c > + !Flash: 88 -rwx 1048 Jul 23 2004 12:30:18 +03:00 > multiple-fs > !Flash: 16128000 bytes total (4003840 bytes free) > ! > ! > !VTP: VTP Version : 2 From yuvalba at netvision.net.il Fri Jul 23 21:20:42 2004 From: yuvalba at netvision.net.il (Yuval Ben-Ari) Date: Fri, 23 Jul 2004 23:20:42 +0200 Subject: 3550 - 12.1(22)EA1 - multiple-fs Message-ID: > Fri, Jul 23, 2004 at 12:49:32PM +0200, Yuval Ben-Ari: > > > > Hi, > > > > Recently upgraded a 3550 to 12.1(22)EA1 and I see new file > in the flash > > called "multiple-fs" which causes config oscillation. > > Any idea what it's for, and how to stop it from causing > changes (beside > > filtering the line) ? > > can you 'more' the file? i dont know what it is. does the > size change > or just the date? no, 3550#more flash:multiple-fs %Error opening flash:multiple-fs (Permission denied) 3550# > asp, can we re-visit the time/space filtering? maybe we can > come up with > some regexes to make file names that we want unfiltered and filter the > time and size from the remaining. > > I should mention 2 more things: 1. I am running rancid 2.2.2 2. I currently use a custom changes to ShowFlash routine that filters following files on Catalyst devices: /config\.te?xt|vlan\.dat|snmpengineid|private-config/ So I guess this is no new problem, only new file :( I guess I should add it to the list. Tell me if there is smarter solution. Thanks Yuval From booloo at ucsc.edu Mon Jul 26 18:36:14 2004 From: booloo at ucsc.edu (Mark Boolootian) Date: Mon, 26 Jul 2004 11:36:14 -0700 Subject: lockfile problem with 2.3.1 Message-ID: <20040726183614.GA39771@root.ucsc.edu> Folks, I've just upgraded to 2.3.1, following the instructions per UPGRADING. When I fire up rancid-run, I find that it queries all the routers just fine, but then hangs complaining about the lockfile (log entries below). Any ideas what this complaint is telling me? thnx, mb --- cvs commit: [17:38:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs cvs commit: [17:39:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs cvs commit: [17:39:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs cvs commit: [17:40:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs cvs commit: [17:40:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs cvs commit: [17:41:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs cvs commit: [17:41:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs cvs commit: [17:42:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone /configs From heas at shrubbery.net Mon Jul 26 18:55:43 2004 From: heas at shrubbery.net (john heasley) Date: Mon, 26 Jul 2004 11:55:43 -0700 Subject: lockfile problem with 2.3.1 In-Reply-To: <20040726183614.GA39771@root.ucsc.edu> References: <20040726183614.GA39771@root.ucsc.edu> Message-ID: <20040726185543.GM18679@shrubbery.net> Mon, Jul 26, 2004 at 11:36:14AM -0700, Mark Boolootian: > > Folks, > > I've just upgraded to 2.3.1, following the instructions per UPGRADING. > When I fire up rancid-run, I find that it queries all the routers just > fine, but then hangs complaining about the lockfile (log entries below). > Any ideas what this complaint is telling me? my best guess is that either - another cvs process is running which legitimately has a lock on this dir or - a cvs process was running with the dir locked at the time you copied/moved the repository or - a cvs process was abruptly terminated and left the stale lock behind iirc, the lock file names begin with .# (see cvs(1)) and will be in the repository heirarchy...where ps and lsof will help you find the owner process. if there is no process, simply removing the file is OFTEN ok. again, see cvs(1). > thnx, > mb > > --- > > cvs commit: [17:38:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs > cvs commit: [17:39:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs > cvs commit: [17:39:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs > cvs commit: [17:40:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs > cvs commit: [17:40:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs > cvs commit: [17:41:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs > cvs commit: [17:41:40] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs > cvs commit: [17:42:10] waiting for rancid's lock in /usr/local/rancid/var/rancid/CVS/Backbone > /configs From jeremy.guthrie at berbee.com Thu Jul 29 03:06:08 2004 From: jeremy.guthrie at berbee.com (Jeremy M. Guthrie) Date: Wed, 28 Jul 2004 22:06:08 -0500 Subject: cssrancid script issues Message-ID: <200407282206.28002.jeremy.guthrie@berbee.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Two problems: 1. I am not fluent in perl. I've been able hack a few things but not successfully make major changes. Not that I expect people to fix me but I may be able to offer access to test hardware. 2. When I run cssrancid on a 2nd Generate CSS I get: cssrancid -d l-cust-msn-1.msn-cust.com executing clogin -t 90 -c"term length 65535;copy profile user-profile;show version;show boot;show running-config" l-cust-msn-1.msn-cust.com HIT COMMAND:l-harley-msn-1# term length 65535 HIT COMMAND:l-harley-msn-1# term length 65535 l-cust-msn-1.msn-cust.com: found unexpected command - "term length 65535" HIT COMMAND:l-harley-msn-1# copy profile user-profile HIT COMMAND:l-harley-msn-1# copy profile user-profile l-cust-msn-1.msn-cust.com: found unexpected command - "copy profile user-profile" HIT COMMAND:l-harley-msn-1# show version In ShowVersion: l-harley-msn-1# show version HIT COMMAND:l-harley-msn-1# show running-config In ShowRun: l-harley-msn-1# show running-config l-cust-msn-1.msn-cust.com: missed cmd(s): show boot l-cust-msn-1.msn-cust.com: missed cmd(s): show boot l-cust-msn-1.msn-cust.com: End of run not found l-cust-msn-1.msn-cust.com: End of run not found My questions 1. why the complaints about the unexpected commands when they should be expected from what I can tell by looking at the code? 2. it is complaining about not seeing End of run, so I changed: # end of config. the ": " game is for the PIX if (/^(: +)?end$/ || /CSS.*#/ || /$prompt/ ) { $found_end = 1; to # end of config. the ": " game is for the PIX if (/^(: +)?end$/ || /l-.*#/ || /CSS.*#/ || /$prompt/ ) { $found_end = 1; These changes did not fix this. We change our CSS prompt to reflect which CSS we're actually on rather than leaving the Cisco default(ie. CSS11501 or CSS11050). How do I fix this? It fails on both Gen-1 CSSes and Gen-2. For sure I can provide access to a CSS11050(aka 1st gen) device. I may be able to provide a 2nd gen(11501/3/6). Plus I have a few more commands we may want to add(a la 'show scripts', 'show ssl files') , etc... - -- - -------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie at berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBCGmyqtjaBHGZBeURAuS0AJ9phGrckLcDhyud/jesej6XF5ThcACfT9sd z3yvVUCFXM1yt9BG0OQSBSk= =DMbk -----END PGP SIGNATURE----- From jeremy.guthrie at berbee.com Thu Jul 29 03:09:00 2004 From: jeremy.guthrie at berbee.com (Jeremy M. Guthrie) Date: Wed, 28 Jul 2004 22:09:00 -0500 Subject: cssrancid script issues(correction of script output) In-Reply-To: <200407282206.28002.jeremy.guthrie@berbee.com> References: <200407282206.28002.jeremy.guthrie@berbee.com> Message-ID: <200407282209.02557.jeremy.guthrie@berbee.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 My output parser screwed up output.... down below is the correct output for the correct device. cssrancid -d l-cust-msn-1.msn-cust.com executing clogin -t 90 -c"term length 65535;copy profile user-profile;show version;show boot;show running-config" l-cust-msn-1.msn-cust.com HIT COMMAND:l-cust-msn-1# term length 65535 HIT COMMAND:l-cust-msn-1# term length 65535 l-cust-msn-1.msn-cust.com: found unexpected command - "term length 65535" HIT COMMAND:l-cust-msn-1# copy profile user-profile HIT COMMAND:l-cust-msn-1# copy profile user-profile l-cust-msn-1.msn-cust.com: found unexpected command - "copy profile user-profile" HIT COMMAND:l-cust-msn-1# show version In ShowVersion: l-cust-msn-1# show version HIT COMMAND:l-cust-msn-1# show running-config In ShowRun: l-cust-msn-1# show running-config l-cust-msn-1.msn-cust.com: missed cmd(s): show boot l-cust-msn-1.msn-cust.com: missed cmd(s): show boot l-cust-msn-1.msn-cust.com: End of run not found l-cust-msn-1.msn-cust.com: End of run not - -- - -------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie at berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBCGpMqtjaBHGZBeURAslmAJ9IT/T6pg0RhIUE31NYPKTFzkN9cQCdHNUc 6Hd7lUfXhffwL+6EoLhywug= =heAs -----END PGP SIGNATURE----- From heas at shrubbery.net Thu Jul 29 19:02:39 2004 From: heas at shrubbery.net (john heasley) Date: Thu, 29 Jul 2004 12:02:39 -0700 Subject: cssrancid script issues(correction of script output) In-Reply-To: <200407282209.02557.jeremy.guthrie@berbee.com> References: <200407282206.28002.jeremy.guthrie@berbee.com> <200407282209.02557.jeremy.guthrie@berbee.com> Message-ID: <20040729190239.GA838@shrubbery.net> Please try the attached patch. -------------- next part -------------- Index: cssrancid.in =================================================================== RCS file: /home/rancid/.CVS/rancid/bin/cssrancid.in,v retrieving revision 1.4 diff -u -r1.4 cssrancid.in --- cssrancid.in 11 Jan 2004 03:49:13 -0000 1.4 +++ cssrancid.in 29 Jul 2004 18:57:01 -0000 @@ -141,7 +141,6 @@ while () { tr/\015//d; - study; last if(/^$prompt/); next if(/^(\s*|\s*$cmd\s*)$/); return(-1) if (/command authorization failed/i); @@ -254,6 +253,8 @@ sub TermLength { # Dummy subroutine.. need to set term length differently for CSS # boxes as term length 0 doesnt work correctly. POS. + print STDERR " In TermLength: $_" if ($debug); + $_ = ; return(0); } @@ -264,6 +265,8 @@ ## of couse breaks the interaction... strangely enough tho ## in a failover environment, only the secondary behaves this ## way.. the primary lets you log out and does not complain. + print STDERR " In CopyProfile: $_" if ($debug); + $_ = ; return(0); } @@ -283,6 +286,7 @@ return(1) if /Ambiguous command/i; # return(1) if /(Invalid input detected|Type help or )/; return(1) if /(Open device \S+ failed|Error opening \S+:)/; + next if (/\*\* BOOT CONFIG /); next if /CONFGEN variable/; if (!defined($H0)) { $H0=1; ProcessHistory("COMMENTS","keysort","H0","!\n"); @@ -305,17 +309,18 @@ # This routine processes a "show run" sub ShowRun { print STDERR " In ShowRun: $_" if ($debug); - my($lineauto) = 0; + my($lines) = 0; while () { tr/\015//d; - study; - last if(/^$prompt/); + if(/^$prompt/) { + $found_end = 1 if ($lines > 4); + return(1); + } 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 - $lineauto = 0 if (/^[^ ]/); # skip the crap if (/^(##+$|(Building|Current) configuration)/i) { while () { @@ -335,13 +340,13 @@ /^! (Last configuration|NVRAM config last)/ && next; ## CSS specific.... /Generated on/ && next; + $lines++; # Dog gone Cool matches to process the rest of the config /^tftp-server flash / && next; # kill any tftp remains /^ntp clock-period / && next; # kill ntp clock-period /^ length / && next; # kill length on serial lines /^ width / && next; # kill width on serial lines - $lineauto = 1 if /^ modem auto/; /^ speed / && $lineauto && next; # kill speed on serial lines /^ clockrate / && next; # kill clockrate on serial interfaces if (/^(enable )?(password|passwd) / && $filter_pwds >= 1) { @@ -360,11 +365,9 @@ } next; } - if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) { - if ($filter_pwds == 2) { - ProcessHistory("USER","keysort","$1","!username $1$2 password \n"); - } elsif ($filter_pwds == 1 && $4 ne "5"){ - ProcessHistory("USER","keysort","$1","!username $1$2 password \n"); + if (/\s*username (\S+)(\s.*)? (des-password|password) (\S+|\S+)/) { + if ($filter_pwds >= 1) { + ProcessHistory("USER","keysort","$1","! username $1$2 $3 $'\n"); } else { ProcessHistory("USER","keysort","$1","$_"); } @@ -537,11 +540,6 @@ # catch anything that wasnt matched above. ProcessHistory("","","","$_"); - # end of config. the ": " game is for the PIX - if (/^(: +)?end$/ || /CSS.*#/ || /$prompt/ ) { - $found_end = 1; - return(1); - } } return(0); } @@ -599,12 +597,13 @@ } ProcessHistory("","","","!RANCID-CONTENT-TYPE: cisco-css\n!\n"); -ProcessHistory("COMMENTS","keysort","B0","!\n"); -ProcessHistory("COMMENTS","keysort","F0","!\n"); -ProcessHistory("COMMENTS","keysort","G0","!\n"); +#ProcessHistory("COMMENTS","keysort","B0","!\n"); +#ProcessHistory("COMMENTS","keysort","F0","!\n"); +#ProcessHistory("COMMENTS","keysort","G0","!\n"); TOP: while() { - tr/\015//d; +NEXT: + tr/\015//d; if (/\#\s?exit/) { $clean_run=1; last; @@ -615,23 +614,27 @@ $clean_run=0; last; } - while (/#\s*($cmds_regexp)\s*$/) { + if (/#\s*($cmds_regexp)\s*$/) { $cmd = $1; - if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; } + if (!defined($prompt)) { + $prompt = ($_ =~ /^([^#]+#)/)[0]; + $prompt =~ s/([][}{)(\\])/\\$1/g; + print STDERR ("PROMPT MATCH: $prompt\n") if ($debug); + } print STDERR ("HIT COMMAND:$_") if ($debug); if (! defined($commands{$cmd})) { print STDERR "$host: found unexpected command - \"$cmd\"\n"; - # $clean_run = 0; - # last TOP; - next TOP; - } else { - $rval = &{$commands{$cmd}}; - delete($commands{$cmd}); - if ($rval == -1) { - $clean_run = 0; - last TOP; - } + $clean_run = 0; + last TOP; + } + $rval = &{$commands{$cmd}}; + delete($commands{$cmd}); + if ($rval == -1) { + $clean_run = 0; + last TOP; } + # the function may have read the next prompt/cmd line + goto NEXT; } } print STDOUT "Done $logincmd: $_\n" if ($log); From jeremy.guthrie at berbee.com Fri Jul 30 02:59:03 2004 From: jeremy.guthrie at berbee.com (Guthrie, Jeremy) Date: Thu, 29 Jul 2004 21:59:03 -0500 Subject: cssrancid script issues(correction of script output) Message-ID: <2DC18B3B8E098147A593039AF00195890DEDF1@CTG-MSNEXC01.staff.berbee.com> Thanks for the quick response. 8) I will give this a try tomorrow and let you know! -----Original Message----- From: john heasley [mailto:heas at shrubbery.net] Sent: Thu 7/29/2004 2:02 PM To: Guthrie, Jeremy Cc: rancid-discuss at shrubbery.net Subject: Re: cssrancid script issues(correction of script output) Please try the attached patch. From jeremy.guthrie at berbee.com Fri Jul 30 04:11:38 2004 From: jeremy.guthrie at berbee.com (Guthrie, Jeremy) Date: Thu, 29 Jul 2004 23:11:38 -0500 Subject: cssrancid script issues(correction of script output) Message-ID: <2DC18B3B8E098147A593039AF00195890DEDF2@CTG-MSNEXC01.staff.berbee.com> didn't work. Here is what I ran to debug: cssrancid -d l-cust-msn-1 > & l-cust-msn-1.log ; clogin -t 90 -c"term length 65535;copy profile user-profile;show version;show boot;show run" l-cust-msn-1 >> & l-cust-msn-1.log Attached is the output. -----Original Message----- From: john heasley [mailto:heas at shrubbery.net] Sent: Thu 7/29/2004 2:02 PM To: Guthrie, Jeremy Cc: rancid-discuss at shrubbery.net Subject: Re: cssrancid script issues(correction of script output) Please try the attached patch. -------------- next part -------------- A non-text attachment was scrubbed... Name: l-cust-msn-1.log Type: application/octet-stream Size: 3615 bytes Desc: l-cust-msn-1.log Url : http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20040729/10c1a7a0/attachment.obj