[Mikrotik] Net::Telnet Mikrotik
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
Re: [Mikrotik] Net::Telnet Mikrotik
I use an expect script that does the telnet. It is reasonably fast. 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 -- Scott Reed Owner NewWays Networking, LLC Wireless Networking Network Design, Installation and Administration Mikrotik Advanced Certified www.nwwnet.net (765) 855-1060 ___ 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
Re: [Mikrotik] Net::Telnet Mikrotik
I've seen telnet take a while to respond before login if there are no DNS resolvers programmed in the unit. Just curious, but have you thought about using the API? http://forum.mikrotik.com/viewtopic.php?f=9t=22744 -- Blake Covarrubias On Jun 30, 2010, at 11:16, Justin Marshall just...@pdmnet.net 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
[Mikrotik] Training for Mikrotik RouterOS August 2010 in Fort Worth, TX
See: http://store.wispgear.net/p334/Mikrotik-RouterOS-Training-in-Fort-Worth-TX/product_info.html for more detail. This training will take place in Fort Worth, TX from August 2-6, 2010. This course is a detailed look at Mikrotik RouterOS V4.x. This is a LIVE, instructor led FULLY INTERACTIVE training course. The first 3 days of this course will cover the following topics among others: * Initial configuration steps with a new Mikrotik Router * Basic network design theory with a focus on practical implementation * Firewall and NAT basics * PPP Tunnels * Wireless network design and practical implementation * Web Proxy implementation * Basic overview of The Dude monitoring application * Use of simple queues for managing customer traffic * And more!! The last 2 days will cover more advanced topics including: Routing Class (MTCRE) * Static and dynamic routing (OSPF) including route filters * Policy routing * Use of tunnels for bridging/routing to remote networks Wireless Course (MTCWE) * Advanced Wireless Design * Wireless Security * Wireless Mesh and WDS -- * Butch Evans * Professional Network Consultation* * http://www.butchevans.com/* Network Engineering * * http://store.wispgear.net/* Wired or Wireless Networks * * http://blog.butchevans.com/ * ImageStream, Mikrotik and MORE! * ___ 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] They stole my equipment!
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Today was the bizarre-est day of 7 years of being a wisp. Today at 2:55pm PDT one of our backhauls went down. It is located on the roof of one of our customers. Nice install with two 24db 5.xGhz antennas on one of our custom roof mounts and the radios. When I arrived I couldn't believe what I saw. The end of the naked cat5 was hanging from the roof. Someone had climbed on the roof and unscrewed the mast and cut the wire and destroyed the backhaul taking down about 100 customers. ( We were thinking of a duplicate backhaul loop and will move forward on that! ). We just can't believe that someone would go to the trouble. We had it all back running in about 1.5 hours and will be installing IP cameras ASAP to secure the location. The homeowner was absent and is hopping mad. Robert Andrews AvantWireless. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMK/TFAAoJEC+8HUjSuDOspkMIAJDERZpXmhDRLfiryRHA9lyn vnDhjX9avJ57jcKOFjZrvbyVtgUQkwuMG66zUWcC8OqWD1mGhC4/i18h1/PkBRLM c1Uck10/M+Wtx7ijycgOLWe7mU63u9KwdifstT+7iGX+BjJ4HxS9TQtEavo+e2fA t6xInOEyQ71l3BKVxrVA5CYmjN7SuNgA340Z7BRlLp67VO+ACVQsVC/H5NbF5El6 sKjFF+PCZz/jnOSO55a05LM66nNaaG/vFvHc2hLODV7RGpr6f84hk/dyRht7/Nav tx5J/lqEUxVwcnMtnbe/bO6GzJG2q1PIQS1/YgGd6Dia+dpCRhm9wjd0AX5b5Fk= =0ivf -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
Re: [Mikrotik] They stole my equipment!
On a building we collocate where the door is often left open, there is a nice PTP600, shooting to a roof top about 15 blocks away that is ladder accessible. Supposedly it got stolen. Regards, Chuck Hogg Shelby Broadband 502-722-9292 ch...@shelbybb.com http://www.shelbybb.com -Original Message- From: mikrotik-boun...@mail.butchevans.com [mailto:mikrotik-boun...@mail.butchevans.com] On Behalf Of Robert Andrews Sent: Wednesday, June 30, 2010 9:52 PM To: Mikrotik discussions Subject: [Mikrotik] They stole my equipment! -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Today was the bizarre-est day of 7 years of being a wisp. Today at 2:55pm PDT one of our backhauls went down. It is located on the roof of one of our customers. Nice install with two 24db 5.xGhz antennas on one of our custom roof mounts and the radios. When I arrived I couldn't believe what I saw. The end of the naked cat5 was hanging from the roof. Someone had climbed on the roof and unscrewed the mast and cut the wire and destroyed the backhaul taking down about 100 customers. ( We were thinking of a duplicate backhaul loop and will move forward on that! ). We just can't believe that someone would go to the trouble. We had it all back running in about 1.5 hours and will be installing IP cameras ASAP to secure the location. The homeowner was absent and is hopping mad. Robert Andrews AvantWireless. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMK/TFAAoJEC+8HUjSuDOspkMIAJDERZpXmhDRLfiryRHA9lyn vnDhjX9avJ57jcKOFjZrvbyVtgUQkwuMG66zUWcC8OqWD1mGhC4/i18h1/PkBRLM c1Uck10/M+Wtx7ijycgOLWe7mU63u9KwdifstT+7iGX+BjJ4HxS9TQtEavo+e2fA t6xInOEyQ71l3BKVxrVA5CYmjN7SuNgA340Z7BRlLp67VO+ACVQsVC/H5NbF5El6 sKjFF+PCZz/jnOSO55a05LM66nNaaG/vFvHc2hLODV7RGpr6f84hk/dyRht7/Nav tx5J/lqEUxVwcnMtnbe/bO6GzJG2q1PIQS1/YgGd6Dia+dpCRhm9wjd0AX5b5Fk= =0ivf -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 ___ 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
Re: [Mikrotik] They stole my equipment!
I have had solor panels and gear stolen, but nothing quite so brash as those. On Wed, Jun 30, 2010 at 6:55 PM, Chuck Hogg ch...@shelbybb.com wrote: On a building we collocate where the door is often left open, there is a nice PTP600, shooting to a roof top about 15 blocks away that is ladder accessible. Supposedly it got stolen. Regards, Chuck Hogg Shelby Broadband 502-722-9292 ch...@shelbybb.com http://www.shelbybb.com -Original Message- From: mikrotik-boun...@mail.butchevans.com [mailto:mikrotik-boun...@mail.butchevans.com] On Behalf Of Robert Andrews Sent: Wednesday, June 30, 2010 9:52 PM To: Mikrotik discussions Subject: [Mikrotik] They stole my equipment! -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Today was the bizarre-est day of 7 years of being a wisp. Today at 2:55pm PDT one of our backhauls went down. It is located on the roof of one of our customers. Nice install with two 24db 5.xGhz antennas on one of our custom roof mounts and the radios. When I arrived I couldn't believe what I saw. The end of the naked cat5 was hanging from the roof. Someone had climbed on the roof and unscrewed the mast and cut the wire and destroyed the backhaul taking down about 100 customers. ( We were thinking of a duplicate backhaul loop and will move forward on that! ). We just can't believe that someone would go to the trouble. We had it all back running in about 1.5 hours and will be installing IP cameras ASAP to secure the location. The homeowner was absent and is hopping mad. Robert Andrews AvantWireless. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMK/TFAAoJEC+8HUjSuDOspkMIAJDERZpXmhDRLfiryRHA9lyn vnDhjX9avJ57jcKOFjZrvbyVtgUQkwuMG66zUWcC8OqWD1mGhC4/i18h1/PkBRLM c1Uck10/M+Wtx7ijycgOLWe7mU63u9KwdifstT+7iGX+BjJ4HxS9TQtEavo+e2fA t6xInOEyQ71l3BKVxrVA5CYmjN7SuNgA340Z7BRlLp67VO+ACVQsVC/H5NbF5El6 sKjFF+PCZz/jnOSO55a05LM66nNaaG/vFvHc2hLODV7RGpr6f84hk/dyRht7/Nav tx5J/lqEUxVwcnMtnbe/bO6GzJG2q1PIQS1/YgGd6Dia+dpCRhm9wjd0AX5b5Fk= =0ivf -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 ___ 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
Re: [Mikrotik] They stole my equipment!
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 the thing that is freaking us out is the lack of cause for the theft... They didn't take anything like the battery box or the other xmitter/receiver. On 06/30/2010 08:16 PM, Jeromie Reeves wrote: I have had solor panels and gear stolen, but nothing quite so brash as those. On Wed, Jun 30, 2010 at 6:55 PM, Chuck Hogg ch...@shelbybb.com wrote: On a building we collocate where the door is often left open, there is a nice PTP600, shooting to a roof top about 15 blocks away that is ladder accessible. Supposedly it got stolen. Regards, Chuck Hogg Shelby Broadband 502-722-9292 ch...@shelbybb.com http://www.shelbybb.com -Original Message- From: mikrotik-boun...@mail.butchevans.com [mailto:mikrotik-boun...@mail.butchevans.com] On Behalf Of Robert Andrews Sent: Wednesday, June 30, 2010 9:52 PM To: Mikrotik discussions Subject: [Mikrotik] They stole my equipment! Today was the bizarre-est day of 7 years of being a wisp. Today at 2:55pm PDT one of our backhauls went down. It is located on the roof of one of our customers. Nice install with two 24db 5.xGhz antennas on one of our custom roof mounts and the radios. When I arrived I couldn't believe what I saw. The end of the naked cat5 was hanging from the roof. Someone had climbed on the roof and unscrewed the mast and cut the wire and destroyed the backhaul taking down about 100 customers. ( We were thinking of a duplicate backhaul loop and will move forward on that! ). We just can't believe that someone would go to the trouble. We had it all back running in about 1.5 hours and will be installing IP cameras ASAP to secure the location. The homeowner was absent and is hopping mad. Robert Andrews AvantWireless. ___ 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 ___ 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/ iQEcBAEBAgAGBQJMLB13AAoJEC+8HUjSuDOsU3kH/iJCFJl3qc1itEKv3+p4Aq/s bL+8TuKC7Hnohy+hjTmWvfY/sWkg5zMrzsXlNw1TL3pvmH90mpZQNtFNFqI7a6Ur j+CGcuANNZ0H8mIdcNs++3432IaCMe6KCcuiPKbFRrq24KjKaufX/PL4wd4T3q6P S2UA9yRu30LqB3UKJiu+F+gi+wv67m/Ks27YZ0exkMpGrhj5VvLPZtcHs5nUesxe Avzu/dnCrPg8aqK251Xh1dS/9d6DTaVaNCVQWDjdBQHQTwdVh5jU05lYJvG8LBlR Eily29+rhL2uXuXiVq+LvMjknsNpE7m5YlmNo+xj7a78hQQSycLEmHXQYmoGu6U= =JMsz -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