[rancid] Help to add new command in rancid script

Alan McKinnon alan.mckinnon at gmail.com
Tue Dec 17 08:20:48 UTC 2013


On 17/12/2013 02:51, Max Vaillant wrote:
> Hi, thanks for the helpful cdp routine. My perl skills are non-existent
> but it seems that the posted code has too many line breaks. 
> 
> Could I bother you for the code in text form?
> 
> I found your post here:
>  http://www.shrubbery.net/pipermail/rancid-discuss/2012-February/006228.html


This part near the end of the routine:

                           "!CDP: Device: $deviceID Platform: $platform
Interface: $1\n") && next;


should be on one line. It got wrapped at column 80.

You will also need to add a line like this to @commandtable (near the
end of the rancid script)

  {'show cdp neighbor detail' => 'ShowCDPDetail'},

otherwise your new code will never be called. Just after "show shun" is
a good place.




-- 
Alan McKinnon
alan.mckinnon at gmail.com



More information about the Rancid-discuss mailing list