#!/usr/bin/env perl
use strict;
use warnings;
use Net::Telnet;
#------------------------------------------------------------------------------
my($host, $username, $password, $prompt, $logFileName) =
(
'unix-box',
'user-name',
'pass-word',
'/\$/',
'xterm.log',
);
my($session);
$session = new Net::Telnet
(
Timeout => 10,
Prompt => $prompt
);
$session -> input_log($logFileName);
$session -> open($host);
$session -> login($username, $password);
# Warning: Use spaces and not tabs to separated fields within these strings.
# Net::Telnet strips the tabs and does not replace them with a space.
# This does not work. Why? Probably the paths to xt in xts:
# $session -> cmd('./bin/xts 192.168.1.2');
$session -> cmd('./bin/xt cornsilk firebrick4 192.168.1.2');
$session -> cmd('./bin/xt lavenderblush indianred4 192.168.1.2');
$session -> cmd('./bin/xt palegoldenrod darkgreen 192.168.1.2');
$session -> cmd('./bin/xt palegoldenrod navyblue 192.168.1.2');
$session -> cmd('./bin/xt whitesmoke dimgray 192.168.1.2');
$session -> close(); |