[rancid] Re: Rancid New Router Type

john heasley heas at shrubbery.net
Thu Apr 16 18:15:19 UTC 2009


Thu, Apr 16, 2009 at 05:14:31PM +0100, Rhys Evans:
> Hi
> 
> I am relatively new to Rancid, and am looking for some help on adding a new router type. I have Rancid up and running for our Cisco and HP devices with no issues. Now back to the question.
> 
> I would like to create a new device type for draytek (I know not great but we do have a few of them) routers . Please bear with me regarding my coding I'm not a programmer,  I am also aware I have removed some of the checks etc. I will look at bring those in once I can get the config out putting fine.
> 
> Now what I have managed to do is the following:
> 
> 
> 1)      Edited rancid-fe and added the line "'draytek'             => 'drancid'," in the vendor table (This seems to be working fine)
> 
> 2)      Hacked the clogin script and renamed it to dlogin. This again seems to be working as it logs into the router and I can enter commands and see the expected output (see end for script)

depending upon what these hacks are, if they are invasive, i suggest a separate
script.

> 3)      I have now created drancid which is a hack of rancid. This is where I am having my issue (see end for script)
> 
> a.       Now when I run "dlogin -d -c 'sys version;sys iface' 79.14.24.56 > debugoutput 2>&1"  I get the following output (which is what I am expecting)
> 
> ++++++++++++++++++++++++++++++++++++++++
> dlogin -d -c 'sys version;sys iface' 79.14.24.56 > debugoutput 2>&1
> 
> 79.14.24.56
> Trying 79.14.24.56...
> Connected to 79.14.24.56.rdns.as8401.net (79.14.24.56).
> Escape character is '^]'.
> 
> Password: **********
> 
> Type ? for command help
> 
> >
> >
> > sys version
> Router Model: Vigor3100 series    Version: v2.7.1 English
> Profile version: 0x2    Status: 1 (0xcd0a7a2)
> Router IP: 192.168.2.1    Netmask: 255.255.255.0
> Firmware Build Date/Time: Wed Nov 29 16:32:4.45 2006
> Revision: 173
> ADSL Firmware Version: R308_1  Annex B
> 
> > sys iface
> Interface 0 Ethernet:
> Status: UP
> IP Address: 192.168.2.1       Netmask: 0xFFFFFF00 (Private)
> IP Address: 79.14.24.56      Netmask: 0xFFFFFFF8
> MAC: 00-50-7F-B7-5C-C8
> Interface 3 PPPoE:
> Status: UP
> IP Address: 79.14.24.56      Netmask: 0xFFFFFFFF
> MAC: 00-50-7F-B7-5C-C9
> > quitConnection closed by foreign host.
> 
> ++++++++++++++++++++++++++++++++++++++++++
> 
> 
> b.      The issue now comes in when I run "drancid -d 79.14.24.56". I don't get the output I expect. I get the following. I suspect this is something to do with the commands in the commandtable calling the subs, I could be totally wrong here. (By the way I'm not looking for formatting at the moment just looking for some output)
> 
> ++++++++++++++++++++++++++++++++++++++++++
>                 drancid -d 79.14.24.56
> executing dlogin -t 30 -c"sys version;sys iface" 79.14.24.56
> 79.14.24.56: missed cmd(s): sys version,sys iface
> 79.14.24.56: missed cmd(s): sys version,sys iface

most likely it is not matching the prompt.  see NOPIPE in rancid.conf(5)
and rancid -df, which are handy testing knobs.


More information about the Rancid-discuss mailing list