473,595 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query in Net::Telnet Module

48 New Member
Hi all,

This is the code I use to login to any device.( I will not be able to see any window but it will be able to login to the device and give the command specified)... can you tell me what changes I should do so that I can see what happens ...(like telnetting to the device ) Hope you can get my question

Expand|Select|Wrap|Line Numbers
  1. $telnet3 = new Net::Telnet(
  2.     Timeout    => 10,
  3.     Errmode    => 'die',
  4. );
  5. $telnet3->open('192.168.134.36'); # Substituted fake IP
  6. $telnet3->waitfor('/Enter login: $/i');
  7. $telnet3->print('user'); # Substituted fake User
  8. $telnet3->waitfor('/Enter password: $/i');
  9. $telnet3->print('pass'); # Substituted fake PW
  10. $telnet3->waitfor('/> $/i');
  11. print "Logged in to device\n";
  12. telnet3->print("reboot");
  13.  
May 22 '07 #1
1 1623
miller
1,089 Recognized Expert Top Contributor
Hi kriz,

Sorry, but I've never used Net::Telnet, so I don't advise you in this. I can only point you to the documentation in hope that they specify something:

cpan Net::Telnet

However, I will point out that it is generally not a good idea to include the IP, login, and password to your device in a public forum post. I've editted out that information from your post, but just wanted to make sure that you avoided doing that in the future.

- Miller
May 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
4116
by: Pete Johansen | last post by:
Hi Folks, This prompt statement has been a real pain in the the butt. I am using net::telnet(v3.03) to connect to a W2K box from a Solaris 2.6 box. I the output stream resulting from a 'dir' command I am getting control characters and a line-feed. Here is an example from the input_log: .. .. ..
2
6083
by: Vinay Gupta | last post by:
Hi, In a Perl to Tcl conversion project, I am planning to use the following Tcl extensions as a replacement for some Perl libraries. My development environment is Windows. Win32::OLE --> "DDE" or "OpTcl" LWP::UserAgent, HTTP::Request --> "Scotty" Net::Telnet --> "Expect" ('spawn telnet') I have used Expect but haven't used Scotty, DDE or OpTcl before.
1
1688
by: jyohere | last post by:
I want to login to a remote machine using Net::Telnet....then i want to move to a particular directory in that remote machine....after that i want to get a list of files under that directory....after that i want to ftp those using Net::Ftp to my machine itself....i am a java programmer....but i wanted to write a script for the above said.....i dont know perl also.,....pls help....plssssss
0
1488
by: shineyang | last post by:
Dear all: Who is kind to help me about the following problem. Why cannot log the remote node by using Net::Telent #################################### The following is normal to the process using "Telnet" #################################### $ telnet 172.30.9.2 Trying 172.30.9.2...
3
2043
by: surajsingh | last post by:
Hi, I have a perl script which uses Net::Telnet module to open a telnet session with my unix boxes, and executes lot of commands on those boxes. As this module is implemented, when 'cmd' is used, this module waits for the 'prompt' to decide whether the command is finished or not. Now in case the 'timeout' is reached before the 'prompt' appears, the module directly throws error (even if the command might actually be running on the remote...
2
4849
by: kriz4321 | last post by:
Hello all i am using net:telnet module to login to the remote machine and execute some commands and to collect some logs corresponding to the command given. After loging into the machine I do patternmatch for a string and collect the logs and store it in a file. The code for the same is given below. $telnet->print('cmd1');#command to be executed sleep(5); ($prematch,$match) = $telnet->waitfor( String => "2>",
2
5725
by: jane007 | last post by:
Hi everybody, Anybody who know how to use Net::Telnet module to execute my own script?Not only to execute system command. Please advise. Thanks.
21
2788
by: poolboi | last post by:
hi guys, a question on net::telnet what does this module do? cos i have a telnet client that will be able to communicate with a database so is it true if i enter my ip address, username, and password and using print later again to execute some commands i will get some results on some screen??
0
3493
by: SteveBark | last post by:
Any pointers on this truly appreciated. I am using net::telnet to connect to a modem pool and then connect with a remote piece of kit. Everything works fine normally, however on occassions the remote piece of kit may be busy and will not talk to me, leaving me to logoff cleanly and try again later. Using net::telnet and the following code I am trying to wait for the prompt of ? to be returned if it is not returned after 60 seconds I wisk...
0
7955
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8251
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5839
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5418
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3873
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2391
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1490
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.