05-08-2009
there is a way..can use input_log() or dump_log() but both the files are empty
10 More Discussions You Might Find Interesting
1. Solaris
Hi my friends
when I want to make boot net for my server I have receive:
Time out ARP/RARP
note: I have use
Ok boot net (this is my Syntax)
so what is the problem? (2 Replies)
Discussion started by: bintaleb
2 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
Hi,
Can anybody help me in writing command "waitfor" for string
"C:\WINNT\Profiles\mfcf0508>" while using net::Telnet module.
I tried the below format :
$telnet->waitfor('/"C\:\WINNT\Profiles\mfcf0508>".*$/i');
Getting error as : pattern match timed-out
Plz help me (1 Reply)
Discussion started by: sudhakaryadav
1 Replies
4. Windows & DOS: Issues & Discussions
Hi,
Can anybody help me in writing command "waitfor" for string
"C:\WINNT\Profiles\mfcf0508>" while using net::Telnet module.
I tried the below format :
$telnet->waitfor('/"C\:\WINNT\Profiles\mfcf0508>".*$/i');
Getting error as : pattern match timed-out
Plz help me (3 Replies)
Discussion started by: sudhakaryadav
3 Replies
5. Shell Programming and Scripting
in "cmd" command i want to copy the ouput of the command excuted to a particular file in a directory.
How to do this..??
Ex : $telnet->cmd(String => 'allip:acl=a1;',Prompt => '/</');
i want to copy o/p of the command "allip:acl=a1;" in a log file in a particular directory.
Plz suggest.. (1 Reply)
Discussion started by: sudhakaryadav
1 Replies
6. Shell Programming and Scripting
Hello,
First of all, congratulations on this forum! Very mice material!
This is my fist thread and it has to do with connecting to an adsl modem and executing some commands.
Heres what I do:
$username = 'admin';
$passwd = 'admin';
$telnet = new Net::Telnet ( Timeout=>10,... (2 Replies)
Discussion started by: Ravendark
2 Replies
7. Shell Programming and Scripting
I'm trying to learn how to get my script to execute the enter button when it telnets into a router and the router displays output but you need to press the space bar or enter button to continue displaying my output of the router.
How is this done? (0 Replies)
Discussion started by: xmaverick
0 Replies
8. Shell Programming and Scripting
I am facing some problem in the NET::FTP Library in perl script in the HPUX. I am using NET::FTP to ftp files from 23 remote servers. Except 1 server everything is working fine. I am getting this error from one server . but normal FTP is working fine for that server. everytime few files are ftped... (1 Reply)
Discussion started by: mohanm
1 Replies
9. Shell Programming and Scripting
Hi,
The code below is used to telnet to list of devices and configure them. The program executes in this manner:
1. telnet to the first device in file.txt
2. one the telnet command is executed a "press any key to continue" prompts.
3. once a return key is executed it ask for username,... (1 Reply)
Discussion started by: sureshcisco
1 Replies
10. Shell Programming and Scripting
I am writing perl script to configure Cisco device but Variables inside Net::Telnet::Cisco Module doesn't work and passed to device without resolving.
Please advise.
here is a sample of script:
use Net::Telnet::Cisco;
$device = "10.14.199.1";
($o1, $o2, $o3, $o4) = split(/\./,$device);... (5 Replies)
Discussion started by: ahmed_zaher
5 Replies
LEARN ABOUT CENTOS
net::telnet
Net::Telnet(3) User Contributed Perl Documentation Net::Telnet(3)
NAME
Net::Telnet - interact with TELNET port or other TCP ports
SYNOPSIS
"use Net::Telnet ();"
see METHODS section below
DESCRIPTION
Net::Telnet allows you to make client connections to a TCP port and do network I/O, especially to a port using the TELNET protocol. Simple
I/O methods such as print, get, and getline are provided. More sophisticated interactive features are provided because connecting to a
TELNET port ultimately means communicating with a program designed for human interaction. These interactive features include the ability
to specify a time-out and to wait for patterns to appear in the input stream, such as the prompt from a shell.
Other reasons to use this module than strictly with a TELNET port are:
o You're not familiar with sockets and you want a simple way to make client connections to TCP services.
o You want to be able to specify your own time-out while connecting, reading, or writing.
o You're communicating with an interactive program at the other end of some socket or pipe and you want to wait for certain patterns to
appear.
Here's an example that prints who's logged-on to the remote host sparky. In addition to a username and password, you must also know the
user's shell prompt, which for this example is "bash$"
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
Prompt => '/bash$ $/');
$t->open("sparky");
$t->login($username, $passwd);
@lines = $t->cmd("who");
print @lines;
More examples are in the EXAMPLES section below.
Usage questions should be directed to the Usenet newsgroup comp.lang.perl.modules.
Contact me, Jay Rogers <jay@rgrs.com>, if you find any bugs or have suggestions for improvement.
What To Know Before Using
o All output is flushed while all input is buffered. Each object contains its own input buffer.
o The output record separator for "print()" and "cmd()" is set to "
" by default, so that you don't have to append all your commands with
a newline. To avoid printing a trailing "
" use "put()" or set the output_record_separator to "".
o The methods "login()" and "cmd()" use the prompt setting in the object to determine when a login or remote command is complete. Those
methods will fail with a time-out if you don't set the prompt correctly.
o Use a combination of "print()" and "waitfor()" as an alternative to "login()" or "cmd()" when they don't do what you want.
o Errors such as timing-out are handled according to the error mode action. The default action is to print an error message to standard
error and have the program die. See the "errmode()" method for more information.
o When constructing the match operator argument for "prompt()" or "waitfor()", always use single quotes instead of double quotes to avoid
unexpected backslash interpretation (e.g. '/bash$ $/'). If you're constructing a DOS like file path, you'll need to use four
backslashes to represent one (e.g. '/c:\\users\\bill>$/i').
Of course don't forget about regexp metacharacters like ".", "[", or "$". You'll only need a single backslash to quote them. The anchor
metacharacters "^" and "$" refer to positions in the input buffer. To avoid matching characters read that look like a prompt, it's a
good idea to end your prompt pattern with the "$" anchor. That way the prompt will only match if it's the last thing read.
o In the input stream, each sequence of carriage return and line feed (i.e. "