jlee has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks, I'm exploring the Net::Telnet module, and am getting a "tset: unknown terminal type network" error. Here's my test script:
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Net::Telnet ();
if ($#ARGV < 2 || $ARGV[0] eq '-h') {
    print "Usage:  telnet1 <systemName> <username> <password>\n";
    exit;
}
my $t = new Net::Telnet->new(Timeout => 10,
			  Input_log => './inputlog.txt',
			  Dump_log => './dumplog.txt');
my ($systemname, $username, $passwd) = @ARGV;
$t->open($systemname);
$t->login($username, $passwd);
my @lines = $t->cmd("/usr/bin/who");
print @lines;
When my perl script does a Telnet::login() to a SuSE Linux machine, it gets the following error (according to my inputlog):
   tset: unknown terminal type network
   Terminal type? 
Apparently during the initial negotiation, Net::Telnet is specifying a terminal type of "network", which SuSE doesn't recognize. Should I talk to the SuSE people and try to convince them to recognize "network"? The SuSE box is at the following Linux version:
   SuSE Linux SLES-7 (PPC) - Kernel 2.4.13-ppc64-SMP (2)
   > uname -a
   Linux linux10 2.4.13-ppc64-SMP #2 SMP Fri Jul 19 17:14:18 GMT 2002 ppc64 unknown
I'm running on AIX, with the following versions of perl stuff:
~> perl -mNet::Telnet -e 'print "Net::Telnet.pm version $Net::Telnet::VERSION\n";'
Net::Telnet.pm version 3.02

~> perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
  Platform:
    osname=aix, osvers=4.1.5.0, archname=aix
    uname='aix side5 1 4 008150374c00 '
    hint=previous, useposix=true, d_sigaction=define
    bincompat3=y useperlio= d_sfio=
    ( ... etcetera ... )
Suggestions, anyone?

Replies are listed 'Best First'.
Re: Net::Telnet "unknown terminal type"
by Flexx (Pilgrim) on Sep 18, 2002 at 16:56 UTC

    Hi!

    I'd try to run the script locally on the SuSE Box, (against localhost), to see if the 'network' termtype is a Net::Telnet or an AIX thing. Maybe setting $ENV{TERM} = 'vt100' will help, but I don't really belive that myself... ;)

    Just my two thoughts on that...

    So long, Flexx

      Thank for the suggestions. Unfortunately it looks like Net::Telnet isn't part of the SuSE distro.

      BTW - Any idea why Net::Telnet isn't included in Perldoc.com's module list ( http://www.perldoc.com/perl5.8.0/lib.html )? Is it because Net::Telnet isn't included in all distro's?

        From the command line you can run perldoc Net::Telnet. That should return some documentation if you can't find it on perldoc.com.

        As far as your terminal type problem, I've never run into problems connecting to a remote host with an unknown term type, its ust looks funny, heh.

        -- Can't never could do anything, so give me and inch, I'll make it a mile.

        AFAIK, Net::Telnet is a CPAN module, but it's not part of the standard Perl distribution (that's why it's not on the Perl 5.8.0 Module List). If you search forNet::Telnet at perldoc it's there.

        So long
        Flexx

        AFAIK perldoc.com isn't indexed for even ready for perl5.8.0. If you search for "open", a function that we all know is in perl5.8.0, it won't find it either.

        search.cpan.org is a much better choice for what's "officially" part of CPAN.

            --jb
Re: Net::Telnet "unknown terminal type"
by blm (Hermit) on Sep 19, 2002 at 01:56 UTC
    tset is being run. Something is not ok with tset. You need to fix that From man 1 tset
    Tset initializes terminals. Tset first determines the type of terminal that you are using. This determination is done as follows, using the first terminal type found. 1. The terminal argument specified on the command line.
    And further down
    Once the terminal type has been determined, the terminfo entry for the terminal is retrieved. If no terminfo entry is found for the type, the user is prompted for another terminal type.
    This stuff is gold I tell you GOLD
    TERMINAL TYPE MAPPING When the terminal is not hardwired into the system (or the current system information is incorrect) the terminal type derived from the /etc/ttys file or the TERM environmental variable is often something generic like network, dialup, or unknown. When tset is used in a startup script it is often desirable to provide information about the type of terminal used on such ports.
    And further down still
    /usr/share/terminfo terminal capability database
      Bit late I know, but I've had this problem also. Easiest fix is to put a 'TERM=vt100' in front of the command. So the command string that's executed should be ... TERM=vt100 ; pstree -A