Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Problem with automated telnet script

Problem with automated telnet script

Problem with automated telnet script

I'm stumped.  I've read the docs for Net::Telnet and searched tek-tips and google.  The only thing I found that seems to be related to my problem was something in Russian and the translation didn't help.


I've got a script that telnets to a remote piece of equipment, enters a command, and gets the response.  Then it disconnects and prints the information.

The script works fine on equipment that requires a login, but we've got a few machines that don't require login and on these, the script doesn't work.

From a terminal window, I just telnet to the remote equipment, enter a command, and quit.
[pmildenb@funbox2 cmdr]$ telnet 1111
Connected to
Escape character is '^]'.
  This is the command that's entered
M 12:42:04 01,00 4 UTL QRY CMAP 065 TODC---- TYPE DC104 4 LN MSG:
12218  00000  00000  00000  00000  00000  00000  12307
04207  00000  07011  00000  00000  00000  00000  00512
00000  00000  00000  00000  00000  09906  00000  00000   COMPL

telnet> quit
Connection closed.

When I try to do it through a script, it connects and then I get an error on the line that tries to enter the command.  The telnet object errmsg is "write error: filehandle isn't open"

Here's the telnet object declaration:
        $t = new Net::Telnet (Timeout => 10,
                                Binmode  => 1,
                                Dump_Log => "dlog.txt",
                                Input_log=> "ilog.txt",
                                Host => "",
                                Port => "1111",
                                Errmode => "return");

The dump_log and input_log are empty, so I can't get any clues from them.

I'm using Perl with Net-Telnet-3.03 on a RH Linux 9 box.  I'm trying to telnet into a Tellabs Titan 532 DCCS.  The script works fine on a 532L DCCS.

Rott Paws

 ...It's not a bug.  It's an undocumented feature!!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close