In case anyone can use it, I took Daniel's script and reswizzled a few
things so now you can pass the pod, username and password as variables to
the main script. I also have the logins direct to the port instead of via
the telnet server (because I am too lazy to type the extra expect lines even
though Daniel already did for me :) ).
Here's the main script:
*#!/bin/bash
POD=$1
USER=$2
PASSWORD=$3
gnome-terminal \
--tab -t R1 -e "/home/user1/bin/ipexpert/R1 $POD $USER $PASSWORD" \
--tab -t R2 -e "/home/user1/bin/ipexpert/R2 $POD $USER $PASSWORD" \
--tab -t R4 -e "/home/user1/bin/ipexpert/R4 $POD $USER $PASSWORD" \
--tab -t R5 -e "/home/user1/bin/ipexpert/R5 $POD $USER $PASSWORD" \
--tab -t R6 -e "/home/user1/bin/ipexpert/R6 $POD $USER $PASSWORD" \
--tab -t R7 -e "/home/user1/bin/ipexpert/R7 $POD $USER $PASSWORD" \
--tab -t R8 -e "/home/user1/bin/ipexpert/R8 $POD $USER $PASSWORD" \
--tab -t R9 -e "/home/user1/bin/ipexpert/R9 $POD $USER $PASSWORD" \
--tab -t CAT1 -e "/home/user1/bin/ipexpert/CAT1 $POD $USER $PASSWORD" \
--tab -t CAT2 -e "/home/user1/bin/ipexpert/CAT2 $POD $USER $PASSWORD" \
--tab -t CAT3 -e "/home/user1/bin/ipexpert/CAT3 $POD $USER $PASSWORD" \
--tab -t CAT4 -e "/home/user1/bin/ipexpert/CAT4 $POD $USER $PASSWORD" &
*and here is an example expect script for router1:*
#!/usr/bin/expect -f
set POD [lindex $argv 0]
set USER [lindex $argv 1]
set PASSWORD [lindex $argv 2]
spawn telnet ${POD}ts1.proctorlabs.com 2001
expect "Username:"
send "$USER\n"
expect "Password:"
send "$PASSWORD\n"
interact
*So save the main script and make it executable, let's call it "rl"
(racklogin) to honor some instructor who's all about brevity. Create the
individual expect scripts. Then usage is simple. Say we have pod 109:
*./rl pod109 someuser somepassword*
I haven't tested officially yet, but will tonight on a rack when I have
access to one, but this should work.
Thanks Daniel for doing the hard work.*
*
On Tue, May 4, 2010 at 1:36 PM, Daniel Skeirik <[email protected]> wrote:
> Nick,
> This is probably the wrong way to do this but here is what I am doing:
>
> I run this bash script to open gnome-terminal with named tabs:
>
> #!/bin/bash -e
>
>
>
> gnome-terminal \
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R1" -t R1 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R2" -t R2 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers/FR" -t Frame-SW 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R4" -t R4 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R5" -t R5 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R6" -t R6 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R7" -t R7 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R8" -t R8 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/R9" -t R9 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/BB1" -t BB1 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/BB2" -t BB2 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/BB3" -t BB3 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/SW1" -t SW1 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/SW2" -t SW2 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/SW3" -t SW3 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers-ipx/SW4" -t SW4 1\
> --tab --working-directory=/home/x
> --command="expect /home/x/routers/RAS" -t RAS 1\
> &
>
> each tab calls an expect script in the "/home/x/routers-ipx/" directory
>
> e.g.
>
> #!./expect -f
> spawn telnet pod113ts1.proctorlabs.com
> expect "Username:"
> send "*username*\n"
> expect "Password:"
> send "*password*\n"
> expect "PL-POD-113-TS-RS#"
> send "R4\n"
> expect "Username:"
> send "*username*\n"
> expect "Password:"
> send "*password*\n"
> interact
>
> hope this helps,
> Dan
>
>
> On Tue, 2010-05-04 at 11:21 -0700, nicholas golden wrote:
> > I have been scouring the web looking for something that's like
> > Wintabber, or securecrt that supports multiple windows. I have ubuntu
> > installed for a while, and now that I am working a lot more I have
> > been relying on my gns3 to get me through studies when I don't have
> > time to rack it up at proctor labs.
> >
> > I am basically, completely new to linux in general so I figured out
> > how to install it and all that. I just need something that I can
> > install and use so I can have multiple tabs in ubuntu. Something
> > that's easy to use and to install and doesn't require some crazy
> > command line wizardry to make happen.
> >
> > I was looking at Terminator, but I can't figure it out. I was looking
> > at PuttyCM but not sure what I am doing (lol). I went around on
> > forums, and looked for a long while.Any pointers on how to set up
> > whatever is recommended is appreciated. I'm learning all about it, but
> > still need a little hand holding hehe.
> >
> > Now I am asking here.
> >
> > Any suggestions?
> >
> > thanks!
> >
> > -Nick
> >
> > _______________________________________________
> > For more information regarding industry leading CCIE Lab training, please
> visit www.ipexpert.com
>
>
> _______________________________________________
> For more information regarding industry leading CCIE Lab training, please
> visit www.ipexpert.com
>
_______________________________________________
For more information regarding industry leading CCIE Lab training, please visit
www.ipexpert.com