Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: RANCID: Users

mtlogin script error

 

 

RANCID users RSS feed   Index | Next | Previous | View Threaded


mwlucas at blackhelicopters

Mar 15, 2012, 4:28 PM

Post #1 of 4 (437 views)
Permalink
mtlogin script error

Hi,

Following the newest RouterOS upgrades, RANCID is having trouble
getting router info.

If I try a single command with clogin -c"command" hostname, the
connection works, but the logout fails. "exit" is no longer a valid
logout command on RouterOS; only "quit" works.

Is there a way to easily switch the logout command?

I've appended my clogin output below. The "mikrotiklogin.sh" script is just:

#!/bin/sh
exec ssh -p 2222 $@

Thanks,
==ml

% clogin -t 15 -c"system license print" barn
barn
spawn /usr/local/scripts/microtiklogin.sh -c 3des -x -l admin+ct barn
admin+ct [at] barn's password:








MMM MMM KKK TTTTTTTTTTT KKK
MMMM MMMM KKK TTTTTTTTTTT KKK
MMM MMMM MMM III KKK KKK RRRRRR OOOOOO TTT III KKK KKK
MMM MM MMM III KKKKK RRR RRR OOO OOO TTT III KKKKK
MMM MMM III KKK KKK RRRRRR OOO OOO TTT III KKK KKK
MMM MMM III KKK KKK RRR RRR OOOOOO TTT III KKK KKK

MikroTik RouterOS 5.11 (c) 1999-2011 http://www.mikrotik.com/

[admin [at] LODDENTOWE] >
[admin [at] LODDENTOWE] > terminal length 0
bad command name length (line 1 column 10)
[admin [at] LODDENTOWE] > system license print
software-id: 70LA-H4WP
upgradable-to: v6.x
nlevel: 4
features:
[admin [at] LODDENTOWE] >exit
bad command name exit (line 1 column 1)
[admin [at] LODDENTOWE] > exit
bad command name exit (line 1 column 1)
[admin [at] LODDENTOWE] > exit
bad command name exit (line 1 column 1)
[admin [at] LODDENTOWE] > ^C%



--
Michael W. Lucas
http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/
Latest book: SSH Mastery http://www.michaelwlucas.com/nonfiction/ssh-mastery
mwlucas [at] BlackHelicopters, Twitter @mwlauthor
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss [at] shrubbery
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


bobthebaritone at gmail

Mar 15, 2012, 6:05 PM

Post #2 of 4 (420 views)
Permalink
Re: mtlogin script error [In reply to]

Really easy - in the bottom of the rancid perl code - main loop -
you'll see where it checks for exit - change that to quit!

You will need to change similar entries in the login expect script.

Cheers

Bob

On 16 March 2012 10:28, Michael W. Lucas <mwlucas [at] blackhelicopters> wrote:
> Hi,
>
> Following the newest RouterOS upgrades, RANCID is having trouble
> getting router info.
>
> If I try a single command with clogin -c"command" hostname, the
> connection works, but the logout fails. "exit" is no longer a valid
> logout command on RouterOS; only "quit" works.
>
> Is there a way to easily switch the logout command?
>
> I've appended my clogin output below.  The "mikrotiklogin.sh" script is just:
>
> #!/bin/sh
> exec ssh -p 2222 $@
>
> Thanks,
> ==ml
>
> % clogin -t 15 -c"system license print" barn
> barn
> spawn /usr/local/scripts/microtiklogin.sh -c 3des -x -l admin+ct barn
> admin+ct [at] barn's password:
>
>
>
>
>
>
>
>
>  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
>  MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK
>  MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK
>  MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK
>  MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK
>  MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK
>
>  MikroTik RouterOS 5.11 (c) 1999-2011       http://www.mikrotik.com/
>
> [admin [at] LODDENTOWE] >
> [admin [at] LODDENTOWE] > terminal length 0
> bad command name length (line 1 column 10)
> [admin [at] LODDENTOWE] >  system license print
>    software-id: 70LA-H4WP
>  upgradable-to: v6.x
>         nlevel: 4
>       features:
> [admin [at] LODDENTOWE] >exit
> bad command name exit (line 1 column 1)
> [admin [at] LODDENTOWE] > exit
> bad command name exit (line 1 column 1)
> [admin [at] LODDENTOWE] > exit
> bad command name exit (line 1 column 1)
> [admin [at] LODDENTOWE] > ^C%
>
>
>
> --
> Michael W. Lucas
> http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/
> Latest book: SSH Mastery http://www.michaelwlucas.com/nonfiction/ssh-mastery
> mwlucas [at] BlackHelicopters, Twitter @mwlauthor
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss [at] shrubbery
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss [at] shrubbery
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


froztbyte at froztbyte

Mar 15, 2012, 10:51 PM

Post #3 of 4 (418 views)
Permalink
Re: mtlogin script error [In reply to]

On Thu, 15 Mar 2012 19:28:44 -0400, "Michael W. Lucas"
<mwlucas [at] blackhelicopters> wrote:
> Hi,
>
> Following the newest RouterOS upgrades, RANCID is having trouble
> getting router info.
<snip>

Hi

Not that I can really help with this issue directly, but I've recently
written a post covering another method for using Rancid with Mikrotik
routers. You can find it here:
http://blog.froztbyte.net/2012/03/mikrotik-and-rancid/.

-J


_______________________________________________
Rancid-discuss mailing list
Rancid-discuss [at] shrubbery
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


heas at shrubbery

Mar 20, 2012, 3:43 PM

Post #4 of 4 (405 views)
Permalink
Re: mtlogin script error [In reply to]

Fri, Mar 16, 2012 at 12:05:30PM +1100, bob watson:
> Really easy - in the bottom of the rancid perl code - main loop -
> you'll see where it checks for exit - change that to quit!
>
> You will need to change similar entries in the login expect script.

the original from Chris Boot that is in the current dist already uses
quit.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss [at] shrubbery
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

RANCID users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.