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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::Telnet question

Status
Not open for further replies.

PinkeyNBrain

IS-IT--Management
Dec 12, 2006
279
US
Not 100% if this is more appropriate here or under a unix forum - will likely be doing a cut-n-paste there as well.

I have a script which uses Net::Telnet to telnet into a unix box from Windows. All is well.

Starting to use the same routine to log into a SuSE10 box and am seeing the following in the input_log()
Last login: (bla bla bla)
tset: unknown terminal type network
Terminal type?
I can type in 'ansi', hit return and I'm good to go. But that seems like I'm ignoring the root cause. If I type in 'telnet xxx' from a dos prompt, I do not receive the request for a terminal type.

Any thoughts out there?
 
I think there is a way to emulate specific terminals. Apparently the Suse box doesn't know how to interpret your terminal and doesn't know what to show you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
To an extent I'd agree, but there are a couple of lingering observations that has me continuing to look around
[ol]
[li]Telnet from Win -> SuSE via DOS and TERMTYPE defaults to 'ANSI'[/li]
[li]Telnet from Win -> SuSE via Net::Telnet and TERMTYPE (apparently) defaults to 'network'[/li]
?? How is Net::Telnet affecting this ??
Another angle on things:
[li]Telnet from Win -> AIX box via DOS and TERMTYPE = 'ANSI'[/li]
[li]Telnet from Win -> AIX box via Net::Telnet and TERMTYPE = 'dumb'[/li]
[li]Telnet from SuSE -> AIX box via GnomeTerminal and TERMTYPE = xterm[/li]
(stay with me on this one)
[li]Telnet from Win -> SuSE then within the same session from SuSE -> AIX and the input_log will indicate that 'network' is unknown and switches to 'dumb'[/li]
(I'll get back to why I'm doing #6 in a moment)
[/ol]
If the AIX box sees 'network' and defaults back to 'dumb', I'm not seeing it in any of the *_log files. The fact that it can tells me that there is probably something I can set up on the SuSE box to default to versus asking. HOWEVER, the observation that telneting directly from a DOS/Gnome window will somehow carry it's own specific term type with it (i.e. ANSI/XTERM) tells me that Net::Telnet is indeed influencing TERMTYPE and SuSE doesn't know how to intrepret what Net::Telnet is telling it. I've taken a look through Telnet.pm trying to see if I can find snippets of knowledge .. didn't happen. I was also unable to find a $telnet->termtype(xxx) method to use.

At this point my long term resolution will be to keep examining the SuSE box to see how I can get it to default to something versus asking. In the short term, I'll just add the equivalent of
Code:
if ($host eq 'SuSE') { print "ANSI" }
during the logon sequence as a band-aid.

For those of you reading this far - #6 above: The SuSE box is coming into play because we're moving our ERP system from the AIX box to SuSE. To run in parallel, I've put together a routine that will copy files from the AIX box to SuSE as they change. So in theory, one can log onto either system and not see any difference. There are two base problems, the two servers are in another building and I'm too lazy to walk over there and monitor the copy program to make sure it's running correctly. So the perl routine is telneting from my desk to SuSE, then telneting and/or FTPing over to the AIX box.
 
You should looking into rsync :) Way better for keeping two machines in sync.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top