-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thank you! That made my ssh's totally instantaneous! Huge difference.
Robert On 07/01/2010 09:35 AM, John Vogel wrote: > Depending on the MT version... at some point around 3.2 MT added an > option to append +ct to the username to suppress ansi output and > terminal type detection (I think thats what they do). > > Try changing the login username to admin+ct > > Justin Marshall wrote: >> Hi, >> >> I'm trying to write a simple perl script to automate things on our >> network. I'm using Net::Telnet and (in this case) i would like it just >> to disable ports 2-5 & re-enable them. The script does what i would >> like, but i could literally do it manually much quicker. The other >> devices i've used Net::Telnet on in the past seem to have no issues, >> only on Mikrotik's. From what i can tell it's taking almost 6-8 seconds >> to logon to each device ... It takes that long before i see it disable >> them... >> >> #!/usr/bin/perl >> use Net::Telnet; >> @Hosts[0] = '10.10.10.2'; >> @Hosts[1] = '10.10.10.3'; >> @Hosts[2] = '10.10.10.4'; >> my $mt = new Net::Telnet; >> my $prompt = "/.*> /"; >> $username = "admin"; >> $password = ""; >> foreach $host(@Hosts) { >> $mt->input_log("log.txt"); >> print "Opening Host".$host."\n"; >> $mt->open(Host=>$host); >> $mt->login($username,$password); >> $mt->cmd('/interface disable ether2'); >> $mt->cmd('/interface disable ether3'); >> $mt->cmd('/interface disable ether4'); >> $mt->cmd('/interface disable ether5'); >> sleep 1; >> $mt->cmd('/interface enable ether2'); >> $mt->cmd('/interface enable ether3'); >> $mt->cmd('/interface enable ether4'); >> $mt->cmd('/interface enable ether5'); >> $mt->close; >> } >> >> I've tried changing out 'cmd' with 'print'. Tried using 'waitfor', >> 'prompt' and even manually logging in with 'waitfor('/password:.*$/i') >> ..etc. >> >> Is there anything that I may do to speed this up, or am I just missing >> something? >> >> Thanks, >> Justin >> just...@pdmnet.net >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> <http://www.butchevans.com/pipermail/mikrotik/attachments/20100630/a6a9b6ce/attachment.html> >> _______________________________________________ >> Mikrotik mailing list >> Mikrotik@mail.butchevans.com >> http://www.butchevans.com/mailman/listinfo/mikrotik >> >> Visit http://blog.butchevans.com/ for tutorials related to Mikrotik RouterOS >> >> > > _______________________________________________ > Mikrotik mailing list > Mikrotik@mail.butchevans.com > http://www.butchevans.com/mailman/listinfo/mikrotik > > Visit http://blog.butchevans.com/ for tutorials related to Mikrotik RouterOS > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMLMTIAAoJEC+8HUjSuDOsvH8IAID7eSe0bdsh1WrNAysyqOQP tqWACHeqowBCDWsYHuJnM89rZffFECpSCDGRxjqkYAD8oMwDzCnDzgVdfppKOdfW ykpmT9hHO04j5x66rlRvnACYbDCvBZxLWnqRzlX2+kee/e3i6TyLRX2jRjEmQzyx xM0fX9iX3ka2A+fpKAXuqL09n6p/plXE1NlP47/BgYPSjS0J6oOqh+VGVAOkp1qp S3vlPgNgW0LAiEqg7VQYvmXv9WhhgXuD/yPH03moNB5GHVSTnbqh83WXbgmF/Y2i iDrRfpAwCyP6LkAjuvZpTjjDhgDH2QwkmuMBHNLYZMvkHG5cPb27/2n2RkZl9cU= =VtfG -----END PGP SIGNATURE----- _______________________________________________ Mikrotik mailing list Mikrotik@mail.butchevans.com http://www.butchevans.com/mailman/listinfo/mikrotik Visit http://blog.butchevans.com/ for tutorials related to Mikrotik RouterOS