[rancid] Need help with fixing custom Rancid script (IBM flex switches)

Jethro R Binks jethro.binks at strath.ac.uk
Wed Feb 6 12:20:45 UTC 2013


I don't know much about it either, seems to be something to do with 
Nortel?  Anyway, I've seen this AOS crop up in a few places; the last time 
was on HP c-class blade enclosure ethernet switches rebadged from from 
Blade Network Technologies, GbE2c and so on.  I don't know the history 
behind the rancid module for such.

I'm sure the project will be happy to incorporate any modifications you 
make.  The current one is clearly very basic!

Jethro.



On Wed, 6 Feb 2013, Auzzik wrote:

> Thanks a lot Jethro!
> 
> I have not heard about such company and their products before.
> It worked fine, I just needed to modify scripts to log commands like
> '/info/sys/general', etc.
> 
> If someone needs I can share these modifications.
> 
> Auzzik
> 
> 
> On 05/02/13 20:08, Jethro R Binks wrote:
> > On Tue, 5 Feb 2013, Auzzik wrote:
> > 
> > > Good day,
> > > 
> > > I am trying to backup configs from IBM flex switches.
> > > They have different commands like: /info/l2/dump or /cfg/dump.
> > Did you try the Alteon WebOS alogin and arancid first?  That uses those
> > types of commands:
> > 
> > %commands=(
> >          '/info/sys'             => "ShowVersion",
> >          '/cfg/dump'             => "WriteTerm",
> > );
> > 
> > Jethro.
> > 
> > 
> > 
> > > I made a copy of 'flogin' and 'francid' files: ibmlogin and ibmrancid.
> > > 
> > > I added a new line into /usr/bin/rancid-fe to specify a new device class
> > > 'ibm'.
> > > 
> > > The file has now:
> > > 
> > > %vendortable = (
> > >      'agm'               => 'agmrancid',
> > >      'alteon'            => 'arancid',
> > >      'arista'            => 'arrancid',
> > >      'avocent'           => 'avorancid',
> > >      'baynet'            => 'brancid',
> > >      'cat5'              => 'cat5rancid',
> > >      'cisco'             => 'rancid',
> > >      'cisco-nx'          => 'nxrancid',
> > >      'cisco-xr'          => 'xrrancid',
> > >      'css'               => 'cssrancid',
> > >      'enterasys'         => 'rivrancid',
> > >      'erx'               => 'jerancid',
> > >      'extreme'           => 'xrancid',
> > >      'ezt3'              => 'erancid',
> > >      'f5'                => 'f5rancid',
> > >      'force10'           => 'f10rancid',
> > >      'fortigate'         => 'fnrancid',
> > >      'foundry'           => 'francid',
> > >      'hitachi'           => 'htrancid',
> > >      'hp'                => 'hrancid',
> > > # ibm was added manually
> > >      'ibm'               => 'ibmrancid',
> > >      'juniper'           => 'jrancid',
> > >      'mrtd'              => 'mrancid',
> > >      'mrv'               => 'mrvrancid',
> > >      'netopia'           => 'trancid',
> > >      'netscaler'         => 'nsrancid',
> > >      'netscreen'         => 'nrancid',
> > >      'procket'           => 'prancid',
> > >      'redback'           => 'rrancid',
> > >      'riverstone'        => 'rivrancid',
> > >      'smc'               => 'srancid',
> > >      'tnt'               => 'tntrancid',
> > >      'zebra'             => 'zrancid'
> > > );
> > > 
> > > I specified device names in .cloginrc:
> > > add     user            sw* rancid
> > > add     password        sw* {www.rancid.net}
> > > add     method          sw* ssh
> > > add     autoenable      sw* 1
> > > 
> > > I added device into router.db:
> > > sw1.ibm:ibm:up
> > > 
> > > In ibmrancid I added:
> > > 
> > > sub WriteTerm {
> > > ....
> > > # custom added lines
> > >          if (/^Press q to quit, any other key to continue/) {
> > >                  next;
> > >          }
> > >          if (/script end*/) {
> > >              $found_end = 1;
> > >              return(1);
> > >          }
> > >      }
> > >      return(0);
> > > }
> > > 
> > > So, when I do '/usr/libexec/rancid/ibmrancid -c "/cfg/dump" sw1.ibm' it
> > > works
> > > fine.
> > > When I try to run 'racnid-run -r sw1.ibm" if fails.
> > > 
> > > To troubleshoot I tried to run:
> > > 
> > > /usr/libexec/rancid/ibmrancid -d sw1.ibm
> > > 
> > > executing /usr/libexec/rancid/ibmlogin -t 30 -c"/cfg/dump" sw1.ibm
> > > PROMPT MATCH: >> sw1.aus - Main#
> > > HIT COMMAND:>> sw1.aus - Main# /cfg/dump
> > >      In WriteTerm: >> sw1.aus - Main# /cfg/dump
> > > sw1.ibm /usr/libexec/rancid/ibmlogin error: Error: TIMEOUT reached
> > > sw1.ibm /usr/libexec/rancid/ibmlogin error: Error: TIMEOUT reached
> > > sw1.ibm: End of run not found 0 || 1
> > > sw1.ibm: End of run not found
> > > results: found END string
> > > sw1.ibm: End of run not found
> > > script end  /**** DO NOT EDIT THIS LINE!
> > > 
> > > Also, ibmrancid has the following commands to run:
> > > 
> > > @commandtable = (
> > > #       {'/info/sys/general'    => 'WriteTerm'},
> > > #       {'/info/sys/chassis'    => 'WriteTerm'},
> > > #       {'/info/l2/vlan'        => 'WriteTerm'},
> > > #       {'/info/l2/failovr/trigger'     => 'WriteTerm'},
> > > #       {'/info/transcvr'       => 'WriteTerm'},
> > >          {'/cfg/dump'    => 'WriteTerm'},
> > > );
> > > 
> > > 
> > > Please help me find out what's wrong. Looks like it tries to get run
> > > command
> > > but fails.
> > > 
> > > The outpuif of /cfg/dump looks like (the end):
> > > 
> > > /c/sys/syslog
> > >      console dis
> > > /c/l2/lldp
> > >      on
> > > /c/sys/ntp
> > >      on
> > > /
> > > script end  /**** DO NOT EDIT THIS LINE!
> > > 
> > > 
> > > Thanks.
> > > Auzzik
> > > _______________________________________________
> > > Rancid-discuss mailing list
> > > Rancid-discuss at shrubbery.net
> > > http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
> > > 
> > .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
> > Jethro R Binks, Network Manager,
> > Information Services Directorate, University Of Strathclyde, Glasgow, UK
> > 
> > The University of Strathclyde is a charitable body, registered in
> > Scotland, number SC015263.
> > _______________________________________________
> > 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
> 

.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
Jethro R Binks, Network Manager,
Information Services Directorate, University Of Strathclyde, Glasgow, UK

The University of Strathclyde is a charitable body, registered in
Scotland, number SC015263.


More information about the Rancid-discuss mailing list