Sponsored Content
Top Forums Shell Programming and Scripting Need Help on Telnet using PERL Scripting Post 302279123 by sudhakaryadav on Thursday 22nd of January 2009 03:02:49 AM
Old 01-22-2009
Need Help on Telnet using PERL Scripting

Iam trying to connect to a system through Telnet using net::Telnet Module
#!/usr/bin/perl -w
use net::Telnet
$myPassword = "abcdef";
$telnet = new Net::Telnet ( Timeout=>10,
Errmode=>'die');
$telnet->open (10.10.20.00);
$telnet->waitfor ('/USERCODE: $/i');
$telnet->print('abc');
$telnet->waitfor('/PASSWORD: $/i');
$telnet->print("$myPassword");
$telnet->waitfor ('< $/i');
$telnet->print (who);
after running script gettting following error
root@sun>./tes.pl
pattern match timed-out at ./tes.pl line 7

Please help me
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

scripting Telnet

can someone tell me how i can write a shell script that will automatically log me in to any machines i want without bothering me for some password input? (i know i have to put in a password but I would like to take care of that in the script) can anyone help me here? (2 Replies)
Discussion started by: TRUEST
2 Replies

2. UNIX for Dummies Questions & Answers

Telnet FTP scripting

Hi quick question from a unix newbie Working on a project to get me using unix, the point of this project is to find a printer on the network check for jobs in the printer if the printer has no jobs do nothing if the printer has jobs then check the status for errors and e-mail the user. This... (2 Replies)
Discussion started by: w33man
2 Replies

3. Shell Programming and Scripting

Shell scripting with Telnet

Hi, im brasilian, sorry for bad english ok? Well, im writing one honeypot, look: #!/bin/bash echo "" echo `cat /etc/welcome.pot` echo "" echo -n "login: "; read usuario echo -n "Password: " #stty -echo read -s senha #stty echo exit Running it in localhost, thats right: ... (1 Reply)
Discussion started by: juniordevil
1 Replies

4. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

5. Shell Programming and Scripting

BASH (or else) scripting for Telnet

Hi everybody, I am thinking on writing a shell script to telnet to Cisco routers, and I am looking for help. I have researched some and could not find much on the topic, or at least much of help anyway... I read "expect" is one solution, but I am looking for something more flexible, as I... (1 Reply)
Discussion started by: ppucci
1 Replies

6. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

7. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

8. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

9. Shell Programming and Scripting

Telnet using shell Scripting

i have written a script as shown below : telnet 10.161.240.2 8100 <?xml version="1.0"?> <login_command> <sequence id="1" /> <access id="1"/> <user name = "user1" password = "pass"/> </login_command> <?xml version="1.0"?> <RegistrationDescriptor> <sequence id="1" /> <access id="1"/>... (4 Replies)
Discussion started by: akrati1
4 Replies

10. Shell Programming and Scripting

Expect scripting telnet stop on bad username or password

I am trying to build and expect script to log into multiple aix boxes and change password. I need for the script to terminate if it cannot log into a server because the username or password is wrong. #!/usr/bin/expect set timeout 1 set host set user set password set uh "Unknown host" set... (3 Replies)
Discussion started by: leemalloy
3 Replies
fence_baytech(8)					      System Manager's Manual						  fence_baytech(8)

NAME
fence_baytech - I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server SYNOPSIS
fence_baytech [OPTION]... DESCRIPTION
This fencing agent is written for the Baytech RPC27-20nc in combination with a Cyclades terminal server. The Cyclades TS exports the RPC's serial port via a Telnet interface. Other interfaces, such as SSH, are possible. However, this script relies upon the assumption that Telnet is used. Future features to this agent would allow the agent to work with a multitude of different communication protocols such as Telnet, SSH or Kermit. The other assumption that is made is that Outlet names do not end in space. The name "Foo" and "Foo " are identical when the RPC prints them with the status command. fence_baytech accepts options on the command line as well as from stdin. fenced sends parameters through stdin when it execs the agent. fence_baytech can be run by itself with command line options which is useful for testing. Vendor URL: http://www.baytech.net OPTIONS
-a host IP address or hostname to connect to. -h Print out a help message describing available options, then exit. -l login Username name for the switch. -n port The name of the outlet to act upon. -o action The action required. This can be on, off, status or reboot (default) -p password Password for login. -S path Full path to an executable to generate the password for login. -q Quiet mode: print only error messages. -V Print out a version message, then exit. STDIN PARAMETERS
agent = < param > This option is used by fence_node(8) and is ignored by fence_baytech. host = < hostname | ip > IP address or hostname to connect to. login = < param > Login name. action = < param > The action required. This can be on, off, status or reboot (default) passwd = < param > Password for login. passwd_script = < param > Full path to an executable to generate the password for login. outlet = < param > The name of the outlet to act upon. SEE ALSO
fence(8), fence_node(8) fence_baytech(8)
All times are GMT -4. The time now is 02:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy