Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with automated telnet script

Status
Not open for further replies.

RottPaws

Programmer
Mar 1, 2002
478
US
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.

Anyway.....

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.
Code:
[pmildenb@funbox2 cmdr]$ telnet 11.11.111.111 1111
Trying 11.11.111.111...
Connected to 11.11.111.111.
Escape character is '^]'.
UTL::QRY,CMAP 065!
This is the command that's entered
Code:
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:
Code:
        $t = new Net::Telnet (Timeout => 10,
                                Binmode  => 1,
                                Dump_Log => "dlog.txt",
                                Input_log=> "ilog.txt",
                                Host => "11.11.111.111",
                                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!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top