[rancid] supermicro switch (again)
Marcin Dulak
marcin.dulak at gmail.com
Tue Nov 22 12:47:00 UTC 2016
On Mon, Nov 21, 2016 at 4:33 PM, heasley <heas at shrubbery.net> wrote:
> Mon, Nov 21, 2016 at 10:26:25AM +0100, Marcin Dulak:
> > naively I do:
> > cp usr/share/perl5/vendor_perl/rancid/edgemax.pm
> > usr/share/perl5/vendor_perl/rancid/supermicro.pm
> > change "package supermicro;" on the top and add a print STDERR ("I'm
> > here"); to ShowVersion,
> > but "I'm here" does no appear in the output of:
>
> you havent a module line in the device config below, so the module is not
> loaded.
>
>
thanks, this was missing. It was also important to specify the module to be
used with "supermicro;script;rancid -t supermicro".
Based on rancid-3.5.1, I managed to get the basic information out of the
switch with the following changes:
$ cat etc/rancid/rancid.types.conf
supermicro;script;rancid -t supermicro
supermicro;login;smlogin
supermicro;inloop;supermicro::inloop
supermicro;module;supermicro
supermicro;command;supermicro::ShowVersion;show version
supermicro;command;supermicro::WriteTerm;show running-config
$ cd usr/share/perl5/vendor_perl/rancid/
$ cp edgemax.pm supermicro.pm
$ cd -
$ patch -p0 < ../module.patch
$ cd usr/libexec/rancid/
$ cp blogin smlogin
$ patch -p0 < ../login.patch
with the patches:
--- usr/share/perl5/vendor_perl/rancid/supermicro.pm.orig 2016-11-22
10:03:53.393367703 +0100
+++ usr/share/perl5/vendor_perl/rancid/supermicro.pm 2016-11-22
10:32:52.577324682 +0100
@@ -1,6 +1,6 @@
-package edgemax;
+package supermicro;
##
-## $Id: edgemax.pm.in 3376 2016-04-06 17:52:30Z heas $
+## $Id: supermicro.pm.in 3376 2016-04-06 17:52:30Z heas $
##
## rancid 3.5.1
## Copyright (c) 1997-2016 by Terrapin Communications, Inc.
@@ -54,7 +54,7 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# edgemax.pm - Ubiquity ("UBNT") EdgeMAX switch rancid procedures
+# supermicro.pm - Supermicro switch rancid procedures
use 5.010;
use strict 'vars';
@@ -120,7 +120,7 @@
last TOP;
}
}
- if (/\#exit$/) {
+ if (/\# logout$/) {
$clean_run = 1;
last;
}
@@ -337,7 +337,7 @@
ProcessHistory("","","","$_");
# end of config
- if (/^end$/) {
+ if (/\# logout$/) {
$found_end = 1;
return(1);
}
--- usr/libexec/rancid/smlogin.orig 2016-11-22 10:03:43.265367954 +0100
+++ usr/libexec/rancid/smlogin 2016-11-22 10:30:54.329327607 +0100
@@ -1,6 +1,6 @@
-#! /bin/expect --
+#! /usr/bin/expect --
##
-## $Id: blogin.in 3445 2016-08-10 17:15:38Z heas $
+## $Id: smlogin.in 3445 2016-08-10 17:15:38Z heas $
##
## rancid 3.5.1
## Copyright (c) 1997-2016 by Terrapin Communications, Inc.
@@ -52,7 +52,7 @@
# The original looking glass software was written by Ed Kern, provided by
# permission and modified beyond recognition.
#
-# blogin - Bay Networks(Nortel) login
+# smlogin - Supermicro login
#
# Unlike the Cisco's, there is no enable function on the Bay's. Instead
# there are seperate User and Manager accounts. A 'system' command exists,
@@ -498,7 +498,7 @@
global in_proc
set in_proc 1
- send "more off\r"
+ send "no cli pagination\r"
expect $prompt {}
Cleaning usr/libexec/rancid/smlogin, usr/share/perl5/vendor_perl/rancid/
supermicro.pm and making them fully functional for Supermicro would be a
large task.
It would be nicer to have minimal templates to start with, and build the
functionality gradually.
Marcin
> > $ rancid -d -t supermicro supermicro-switch
> >
> > This goes back to my question: what gets executed when I replace
> > "supermicro::" with "dummy::" in
> >
> > $ cat ./etc/rancid/rancid.types.conf
> > supermicro;script;rancid
> > supermicro;login;smlogin
> > supermicro;inloop;supermicro::inloop
> > supermicro;command;supermicro::ShowVersion;show version
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20161122/81e59d0b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: module.patch
Type: text/x-patch
Size: 952 bytes
Desc: not available
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20161122/81e59d0b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: login.patch
Type: text/x-patch
Size: 899 bytes
Desc: not available
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20161122/81e59d0b/attachment-0001.bin>
More information about the Rancid-discuss
mailing list