Nicolas DEFFAYET | 7 Jun 14:47 2014

[rancid] Quagga vtysh patchs

Hello,

Please find the complete files attached that I use successfully with
Rancid 2.3.8 to get config from Quagga vtysh. I have done a big rewrite
for have clean stuff and I use a new qlogin instead of original clogin
because the original clogin don't work correctly since Rancid 2.3.5 due
to various change.

# vi /usr/lib/rancid/bin/rancid-fe
---
-    'zebra' => 'zrancid'
+    'zebra' => 'zrancid',
+    'quagga' => 'qrancid'
---

Put qlogin qrancid
# chown root:root qlogin qrancid
# chmod 755 qlogin qrancid
# mv qlogin qrancid /usr/lib/rancid/bin/

In router.db file
---
test.example.com:quagga:up
---

--

-- 
Nicolas DEFFAYET
#! /usr/bin/expect --
(Continue reading)

Nicolas DEFFAYET | 7 Jun 13:17 2014

[rancid] Cisco SG-300 patchs

Hello,

Please find the complete files attached that I use successfully with
Rancid 2.3.8 to get config from Cisco SG-300. I have done a big rewrite
for have clean stuff and I use a csblogin instead of original clogin.

# vi /var/lib/rancid/bin/rancid-fe
---
     'cisco' => 'rancid',
+    'cisco-sb' => 'csbrancid',
     'cisco-nx' => 'nxrancid',
---

Put csblogin csbrancid
# chown root:root csblogin csbrancid
# chmod 755 csblogin csbrancid
# mv csblogin csbrancid /usr/lib/rancid/bin/

In router.db file
---
test.example.com:cisco-sb:up
---

In .cloginrc
---
add autoenable test.example.com {1}
add method test.example.com {ssh}
add password test.example.com {password}
add user test.example.com {user}
add userprompt test.example.com {"User Name:"}
(Continue reading)

Alan McKinnon | 7 Jun 01:30 2014
Picon

[rancid] [PATCH]

I may have posted this one already. If so, apologies for the dupe.

ACL sorting fails for ipv6 addresses as ipaddrval() always returns false
for these so sorting never happens. Rancid output is then always
whatever order the router presented leading to chatter and noisy diffs.

The simplest solution is to sort ipv6 addresses ASCIIbetically so they
always sort predictably. The only oddity is :: comes after digits 0-9
and before A-F. Aside from that, the order is as expected by hex numbers.

This is much easier than writing an ipv6 sort routine from scratch as
rancid uses no perl user modules.

--- rancid.old  2014-05-16 01:07:20.000000000 +0200
+++ rancid      2014-06-04 01:47:20.000000000 +0200
 <at>  <at>  -168,7 +186,8  <at>  <at> 
     $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
 }
 sub sortbyipaddr {
-    &ipaddrval($a) <=> &ipaddrval($b);
+    &ipaddrval($a) <=> &ipaddrval($b) ||
+    $a cmp $b;
 }

 # This routine parses "show version"
 <at>  <at>  -1874,7 +1898,7  <at>  <at> 
        # order arp lists
        /^arp\s+(\d+\.\d+\.\d+\.\d+)\s+/ &&
            ProcessHistory("ARP","$aclsort","$1","$_") && next;
-       /^ip(v6)?
(Continue reading)

Alan McKinnon | 7 Jun 01:09 2014
Picon

[rancid] [PATCH] Reduce chatter about file sizes in nvram.

Hi,

I got tired of endless noise mails with diffs like this:

- !Flash: nvram:  1692  -rw-      356089                    <no date>
startup-config
+ !Flash: nvram:  1692  -rw-      356257                    <no date>
startup-config
- !Flash: nvram: 2093048 bytes total (1636661 bytes free)
+ !Flash: nvram: 2093048 bytes total (1636493 bytes free)

So I wrote the below to deal with it.
Rationale: I don't care to know that the file increased by 168 bytes,
all I want to know is if the file was created or deleted and it's
approximate size. I'd also like to know if the size changed dramatically
eg 100K to 10M.
The patch transforms the size to the nearest SI unit and truncates it to
an integer, like so:

!Flash: nvram:  1691  -rw-       347KB                    <no date>
startup-config
!Flash: disk0:        1MB bytes total (       1MB bytes free)

The diff is against 2.3.8 and I have similar ones for nxrancid and
xrrancid. Also gsrrancid but that's my own creation for GSRs and not in
the source tarballs.

--- rancid.old  2014-05-16 01:07:20.000000000 +0200
+++ rancid      2014-06-04 01:47:20.000000000 +0200
 <at>  <at>  -95,6 +95,24  <at>  <at> 
(Continue reading)

Manfred Mayer IT | 6 Jun 15:40 2014
Picon

[rancid] clogin: not found

Hi all,

I try to migrate my existing rancid-2.3.8 installation to a new host with Ubuntu 12.04. I downloaded
ftp://ftp.shrubbery.net/pub/rancid/rancid-2.3.8.tar.gz and installed it to /usr/local/rancid. I
copied the .cloginrc and rancid.conf to the new host and wanted to test with a new router.db first,
containing only 6 HP Procurve switches (switchname:hp:up). I can login successfully to each switch with
"bin/clogin switchname" and I also tried "bin/hlogin -f .cloginrc -c "show version" switchname" which
gives me a "no page" output first, but then the version and a completed logout.

But executing "bin/rancid switchname" results in the following:
sh: 1: clogin: not found
switchname: missed cmd(s): dir /all slavedisk2:,show rsp chassis-info,show capture,dir /all
sec-slot2:,show diag,dir:
switchname: End of run not found
!

I found this existing thread
http://www.shrubbery.net/pipermail/rancid-discuss/2008-November/003404.html but however I
don't know what to do exactly to solve the problem.

Any suggestions would be appreciated

Regards
Mana

Rapunzel Naturkost GmbH, Rapunzelstra?e 1, D-87764 Legau
Registergericht Memmingen HRB 14736  | Sitz der Gesellschaft: Legau
Ust Id Nr. DE 129088402
Gesch?ftsf?hrer: Joseph Wilhelm | Margit Epple | Andreas Wenning
Telefon: +49 (0)8330 / 529 - 0
(Continue reading)

Craig Ayliffe | 6 Jun 02:52 2014
Picon

Re: [rancid] Help for nlogin and Netscreen

Hi,

Apologies the link that failed was meant to be: http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

It is found on this page: http://www.shrubbery.net/rancid/#help


Yes agreed it is a broken implementation of the CLI.
I will take a look at the -s option.

Thanks,

Craig

On 6 June 2014 03:53, <rancid-discuss <at> shrubbery.net> wrote:
Thu, Jun 05, 2014 at 03:15:41PM +1000, Craig Ayliffe:
> Hi,
>
> Firstly I tried to subscribe to the mailing list at
> http://www.shrubbery.net/pipermail/rancid-discuss/ - but get a 404 error
> going to that page.

that url looks fine to me.  in the logs, i see some failures with bad urls,
which might have been you.  if you can verify what url doesnt work and where
you found the url or the referring page, i'll look.

> Anyway my problem today is trying to run the command:
>    nlogin -t 90 -f vfw.cloginrc -c "exec nsrp sync global-config check-sum"
> hostname
>
> It runs the command successfully but then hangs waiting to finish.
> The output of the command (configuration in sync) is printed out after the
> prompt is displayed which seems to get nlogin out of sync - still looking
> for the prompt which it doesn't see again.
>
> Attached is the debug of the commands being run.
>
> Below is it running without debug.
> ==============================================
> craiga <at> syd-monitor-01:~/juniper$ /tmp/nlogin.3.1 -t 90 -f vfw.cloginrc -c
> "exec nsrp sync global-config check-sum" bne-vfw-1b
> bne-vfw-1b
> spawn ssh -c 3des -x -l craiga bne-vfw-1b
> craiga <at> bne-vfw-1b's password:
> Remote Management Console
> BNE-VFW-1b(B)->
> BNE-VFW-1b(B)-> set console page 0
> BNE-VFW-1b(B)-> exec nsrp sync global-config check-sum
> *BNE-VFW-1b(B)-> configuration in sync*
>
>
> ^Ccraiga <at> syd-monitor-01:~/juniper$
> ==============================================
>
> As far as I can see this is due to Netscreen running this command in the
> background and it returns the display later on after the new prompt is
> already there.
> This doesn't happen when I run the 'get' commands in Netscreen.
>
> Any ideas on how to fix this would be awesome thanks

eh, you could do that with a script via nlogin -s.  but, once it receives a
new prompt, the login scripts assume the command is done.  to that do a cmd
in the background is a completely broken cli way to do it, imo, and i'd
complain to the vendor.

see the share dir of the dist for -s examples.



--
Craig Ayliffe
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Kenneth Lind | 5 Jun 20:24 2014
Picon

Re: [rancid] Cisco 10k sflog Timestamp Cycling

This is a fairly old issue so I'm including the previous threads for what
it's worth. We upgraded to Rancid v3.0 and then today to v3.1 without issue.
The upgrade to 3.0a did hush the actual sflog diffs, however, we are still
receiving noisy diffs related to the sflog/IPDR data and the fact that n
bytes are stored in flash before being sent to the collector.

What would be the best method to hush these diffs?

Example of diffs:
  !Flash:                                           sflog
- !Flash: 821772288 bytes available (202817536 bytes used)
+ !Flash: 821805056 bytes available (202784768 bytes used)
  !

> -----Original Message-----
> From: 'heasley' [mailto:heas <at> shrubbery.net]
> Sent: Thursday, November 07, 2013 2:56 PM
> To: Kenneth Lind
> Subject: Re: [rancid] Cisco 10k sflog Timestamp Cycling
> 
> Thu, Nov 07, 2013 at 07:44:33PM +0000, 'heasley':
> > Thu, Oct 31, 2013 at 11:34:51AM -0400, Kenneth Lind:
> > > > -----Original Message-----
> > > > From: heasley [mailto:heas <at> shrubbery.net]
> > > > Sent: Wednesday, October 30, 2013 6:42 PM
> > > > To: Kenneth Lind
> > > > Subject: Re: [rancid] Cisco 10k sflog Timestamp Cycling
> > > >
> > > > Tue, Oct 29, 2013 at 04:26:18PM -0400, Kenneth Lind:
> > > > > > -----Original Message-----
> > > > > > From: rancid-discuss-bounces <at> shrubbery.net
> > > > > > [mailto:rancid-discuss- bounces <at> shrubbery.net] On Behalf Of
> > > > > > Alan McKinnon
> > > > > > Sent: Tuesday, October 22, 2013 4:19 PM
> > > > > > To: rancid-discuss <at> shrubbery.net
> > > > > > Subject: Re: [rancid] Cisco 10k sflog Timestamp Cycling
> > > > > >
> > > > > > On 22/10/2013 17:27, Kenneth Lind wrote:
> > > > > > > We recently implemented IPDR on our Cisco 10K uBRs and are
> > > > > > > now receiving diffs for every rancid run about the
> timestamp
> > > > > > > for the
> > > > > > sflog:
> > > > > > >
> > > > > > > - !Flash: 6            0 Oct 22 2013 08:46:10 -04:00 sflog
> > > > > > > + !Flash: 6            0 Oct 22 2013 09:37:28 -04:00 sflog
> > > > > > >
> > > > > > > We are running Rancid v2.3.6 which according to the change
> > > > > > > log included the fix for this issue (though in our instance
> > > > > > > it does not appear to be filtered, unless there is an
> option
> > > > > > > somewhere that we've missed to enable the filtering):
> > > > > > >
> > > > > > > rancid: filter sflog from DirSlotN() for IOS on cisco 10k
> > > > > > >
> > > > > > > I've been able to find mentions of the issue in the discuss
> > > > > > > archives, but none have included a solution. Has anyone
> been
> > > > > > > able to hush the diffs for the sflog outside of creating a
> > > > > > > new rancid type and
> > > > > > altering
> > > > > > > the command table to exclude the DirSlotN run?
> > > > > >
> > > > > > I'm not familiar with the 10k but Google indicates they will
> > > > > > run regular IOS. Is that correct?
> > > > >
> > > > > 10k does run IOS. There are some specialized-for-the-purpose
> > > > > commands/configuration, but it is still standard IOS
> (12.2(33)).
> > > > >
> > > > > >
> > > > > > The code in 2.3.6 does support what the Changelog says:
> > > > > >
> > > > > > sub DirSlotN {
> > > > > >     ....
> > > > > >     if ($ios eq "IOS" &&
> /^((\s+)?\d+\s+\S+)\s+\d+.*(sflog$)/) {
> > > > > >         $_ = "$1" . sprintf("%43s", "") . "$3\n";
> > > > > >     }
> > > > > >     ....
> > > > > > }
> > > > > >
> > > > > > but that regex does not match the output you quoted. maybe
> > > > > > that was written for
> > > > > >
> > > > > > Personally, I would simply discard the entire line (you don't
> > > > > > want to keep the timestamp and that is the very thing that is
> > > > > > changing) so modify DirSlotN thusly (add it just before the
> code above):
> > > > > >
> > > > > >     next if ($ios eq "IOS" && /^Flash:.*? sflog$);
> > > > > >
> > > > > > that regex is quite simplistic, you might want to tweak it to
> > > > > > be more specific.
> > > > > >
> > > > >
> > > > > Heasley replied directly to me with the following diff from
> > > > > Rancid
> > > > v3.0a:
> > > > > Index: lib/ios.pm.in
> > > > >
> ===================================================================
> > > > > --- lib/ios.pm.in	(revision 2731)
> > > > > +++ lib/ios.pm.in	(working copy)
> > > > >  <at>  <at>  -884,7 +884,7  <at>  <at> 
> > > > >  	# to:
> > > > >  	#       -rw-                                   vlan.dat
> > > > >  	#       -rw-
> vlan.dat
> > > > > -	if (/(dhcp_[^. ]*\.txt|vlan\.dat)\s*$/) {
> > > > > +	if (/(dhcp_[^. ]*\.txt|vlan\.dat|sflog)\s*$/) {
> > > > >  	    if (/(\s*\d+)(\s+\S+\s+)(\d+)(\s+)(\w+ \d+\s+\d+
> > > > > \d+:\d+:\d+
> > > > > .\d+:\d+)/) {
> > > > >  		my($fn, $a, $sz, $c, $dt, $rem) = ($1, $2, $3, $4,
> $5, $');
> > > > >  		my($fnl, $szl, $dtl) = (length($fn), length($sz),
> > > > length($dt));  <at>  <at> 
> > > > > -921,9 +921,6  <at>  <at> 
> > > > >  	if ($ios eq "XE" &&
> /^((\s+)?\d+\s+\S+)\s+\d+.*(tracelogs$)/) {
> > > > >  	    $_ = "$1" . sprintf("%43s", "") . "$3\n";
> > > > >  	}
> > > > > -	if ($ios eq "IOS" && /^((\s+)?\d+\s+\S+)\s+\d+.*(sflog$)/)
> {
> > > > > -	    $_ = "$1" . sprintf("%43s", "") . "$3\n";
> > > > > -	}
> > > > >  	# the pager can not be disabled per-session on the PIX
> > > > >  	if (/^(<-+ More -+>)/) {
> > > > >  	    my($len) = length($1);
> > > > >
> > > > >
> > > > > However, our stock Rancid v2.3.6 looks considerably different
> > > > > and I wasn't able to find the correct location(s) to make the
> changes.
> > > > >
> > > > > I created a proposed diff with changes matching our stock
> Rancid
> > > > > as follows and I wonder if anyone has any input (notice the
> line
> > > > > numbers are considerably different as well as the 'next if'
> statement):
> > > >
> > > > and i replied about your diff below.  did you try it?  you can
> try
> > > > it without changing your installed based.  ./rancid hostname;
> diff
> > > > ~rancid/group/ configs/hostname hostname.new
> > >
> > >
> > > Applying the below proposed changes caused the following errors in
> the log:
> > >
> > > Execution of /usr/local/rancid/bin/rancid aborted due to
> compilation errors.
> > > syntax error at /usr/local/rancid/bin/rancid line 759, near ") {"
> > > Can't use global $1 in "my" at /usr/local/rancid/bin/rancid line
> > > 761, near "($1"
> > > Missing right curly or square bracket at
> > > /usr/local/rancid/bin/rancid line 2085, at end of line
> >
> > the patch wasnt applied properly.
> >
> > >
> > > >
> > > > > Index: bin/rancid
> > > > >
> ================================================================
> > > > > ===
> > > > >  <at>  <at>  -757,9 +757,9  <at>  <at> 
> > > > >         if ($dev =~ /bootflash/) {
> > > > >             next if (/temp_cont\s*$/);
> > > > >             next if (/uptime_cont\s*$/);
> > > > >         }
> > > > >         # Filter dhcp database
> > > > > -       next if (/dhcp_[^. ]*\.txt/);
> > > > > +	  next if (/(dhcp_[^. ]*\.txt|vlan\.dat|sflog)\s*$/) {
> >
> > eg: next is not valid there.  you could just move to rancid 3.0aN,
> > else you will have to correct the application of the patch.
> 
> btw, you need ftp://ftp.shrubbery.net/pub/rancid/alpha/rancid-
> 3.0a3.tar.gz
> then apply the patch i'd sent to you.
> 
> > > > > + 	    if (/(\s*\d+)(\s+\S+\s+)(\d+)(\s+)(\w+ \d+\s+\d+
> > > > > + \d+:\d+:\d+
> > > > > .\d+:\d+)/) {
> > > > > + 		my($fn, $a, $sz, $c, $dt, $rem) = ($1, $2, $3, $4,
> $5, $');
> > > > > + 		my($fnl, $szl, $dtl) = (length($fn), length($sz),
> > > > > length($dt));
> > > > >
> > > > >         if ($ios eq "XE" && /.*\((\d+) bytes free\)/) {
> > > > >             my($tmp) = $1;
> > > > >             if ($tmp >= (1024 * 1024 * 1024)) {
> > > > >                 $tmp = int($tmp / (1024 * 1024 * 1024));
> > > > >                 s/$1 bytes free/$tmp GB free/;
> > > > >             } else {
> > > > >                 $tmp = int($tmp / (1024 * 1024));
> > > > >                 s/$1 bytes free/$tmp MB free/;
> > > > >             }
> > > > >         }
> > > > >         if ($ios eq "XE" &&
> > > > > /^((\s+)?\d+\s+\S+)\s+\d+.*(tracelogs$)/)
> > > > {
> > > > >             $_ = "$1" . sprintf("%43s", "") . "$3\n";
> > > > >         }
> > > > >
> > > > >  <at>  <at>  -772,9 +772,9  <at>  <at> 
> > > > >             }
> > > > >         }
> > > > >         if ($ios eq "XE" &&
> > > > > /^((\s+)?\d+\s+\S+)\s+\d+.*(tracelogs$)/)
> > > > {
> > > > >             $_ = "$1" . sprintf("%43s", "") . "$3\n";
> > > > >         }
> > > > > -	  if ($ios eq "IOS" &&
> /^((\s+)?\d+\s+\S+)\s+\d+.*(sflog$)/) {
> > > > > -           $_ = "$1" . sprintf("%43s", "") . "$3\n";
> > > > > -        }
> > > > >         # the pager can not be disabled per-session on the PIX
> > > > >         if (/^(<-+ More -+>)/) {
> > > > >             my($len) = length($1);
> > > > >             s/^$1\s{$len}//;
> > > > >
> > > > > > Don't stress about maintaining your own patches to make the
> > > > > > rancid scripts do what you intent - every installation I know
> > > > > > of accumulating a rather large number of them :-)  It seems
> to
> > > > > > be inevitable considering the problem we are all using rancid
> > > > > > to
> > > > solve.
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Alan McKinnon
> > > > > > alan.mckinnon <at> gmail.com
> > > > > >
> > > > > > _______________________________________________
> > > > > > Rancid-discuss mailing list
> > > > > > Rancid-discuss <at> shrubbery.net
> > > > > > http://www.shrubbery.net/mailman/listinfo/rancid-discuss
> > > > >
> > > > > _______________________________________________
> > > > > Rancid-discuss mailing list
> > > > > Rancid-discuss <at> shrubbery.net
> > > > > http://www.shrubbery.net/mailman/listinfo/rancid-discuss

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Alexander Bochmann | 4 Jun 10:44 2014
Picon

[rancid] Cisco SG-500 configs?

Hi,

does anyone have rancid 2.3.x patches for Cisco SG-500 switches with current 
software? I've found several pieces of code that claim to support the SG series, 
but none of them acutally work. The new SG switches are quite IOS-like, but not 
enough to work with the normal clogin...

Alex.

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Joshua Lebo | 16 May 22:36 2014
Picon

Re: [rancid] Cisco WLC: Rancid 3.0 add other vendor devices???

Gavin,

I'm having the exact same issues.  I'm also poking around at code, and I have noticed that Rancid::loadtype is a subrouting in lib/rancid/rancid.pm not it's own module.

For completeness, I'm showing my rancid.types.conf contents:

ciscowlc;login;wlogin
ciscowlc;script;ciscowlc5

and my error:


Trying to get all of the configs.
Unknown option: t
ciscowlc5 wlogin error: Error: no password for ciscowlc5 in /home/rancid/.cloginrc.
ciscowlc5: missed cmd(s): show sysinfo,show udi,show run-config commands
ciscowlc5: End of run not found

I was able to resolve 'Unknown option: t' was resolved by catching the option, by editing line 30 and adding 't'.

The above wlogin error should probably read <devicename> instead of <ciscowlc5>, leading me to believe that our scripts are not parsing something correctly.  Did the change in router.db from ':' to ';' in version 3.0 break the script?

Interestingly, if I run ./ciscowlc5 <devicename> from within the bin directory, the complete config is pulled down and saved as a .new file. Password, etc is correctly configured.  So I know the scripts work, having trouble getting them to run via rancid-run in version 3.0.

- Josh

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Olivier Boudry | 14 May 11:19 2014
Picon

[rancid] "rancid -d <devicename>" works, but "rancid-run <groupname>" does nothing

Hi,

I just installed rancid 2.3.8 and configured it as described in http://www.routereflector.com/2013/09/configuration-versioning-using-rancid/

I can get bin/clogin to work for all my devices. bin/rancid -d will also work and create me a localfile called devicename.new and containing the full configuration, but when I try to run the full group of devices "gb1", nothing happens.

The group is defined in etc/rancid.conf as LIST_OF_GROUPS="gb1" (uncommented). I ran rancid-cvs which created the var/gb1 folder, and edited var/gb1/router.db which looks like this:

10.210.9.2|cisco|up
10.210.9.3|cisco|up
10.210.9.4|cisco|up
10.210.9.5|cisco|up

Running "rancid-run gb1", or simply "rancid-run" has no effect. In the log I find the following:

starting: Wed May 14 09:52:28 BST 2014

ending: Wed May 14 09:52:28 BST 2014

But if I run directly "bin/rancid 10.210.9.2", it works and I get the config in 10.210.9.2.new

Any idea what could go wrong and how I could troubleshoot this?

Thanks,

Olivier.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Mark Tinka | 13 May 22:04 2014
Picon

[rancid] Repetitive RANCID Checks

Hi all.

We upgraded to Perl-5.18 today on FreeBSD-10, and rebuilt 
all ports that depend on Perl, including RANCID.

Since then, RANCID has been continuously e-mailing the same  
changes at every interval, even though those changes have 
not been actually effected.

The changes are essentially re-ordered prefix list entries 
for Cisco IOS-based systems.

Anyone know what this is, before I go hacking at this?

RANCID version is 2.3.8. Thanks.

Cheers,

Mark.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Gmane