perl telnet 模块的问题
时间:2010-12-31
来源:互联网
#!/opt/dc_perl
use Net::Telnet;
print "\nUsage: get_alarm.pl remote_host_ip port User_Name Password \n\n";
my $remote_host_ip = $ARGV[0];
my $port = $ARGV[1] ;
my $username = $ARGV[2] ;
my $password = $ARGV[3] ;
my $recv_file_name = $ARGV[4] ;
my $first_cmd ="cd /tellin/oams/oams_run/log";
my $second_cmd = "ps -ef|grep -v grep|grep tail|awk '{print $2}'|xargs kill -9";
my $third_cmd = "tail -f /tellin/oams/oams_run/log/oams_warninglog_usr.log";
print "ip
remote_host_ip\n";
print "port
port\n";
print "login
username\n";
print "passwd
password\n";
my $telnet_hd=new Net::Telnet (Timeout => 3600);
print "now telnet......\n";
#$telnet_hd->open(Host=>$remote_host_ip);
$telnet_hd->open(Host=>$remote_host_ip,Port=>$port);
print "now open ......\n";
$telnet_hd->login(login=>$username,Password=>$password);
print "now login......\n";
执行perl程序的时候提示如下,哪位帮忙看看是啥问题啊?
Usage: get_alarm.pl remote_host_ip port User_Name Password
ip:192.168.1.149
port:23
name
ams
passwd
ams
now telnet......
now open ......
手工telnet服务器的时候
telnet 192.168.1.149
Trying 192.168.1.149...
Connected to 192,168.1.149.
Escape character is '^]'.
Welcome to SUSE Linux Enterprise Server 10 SP1 (x86_64) - Kernel 2.6.16.46-0.12-smp (2).
linux-461u login:
use Net::Telnet;
print "\nUsage: get_alarm.pl remote_host_ip port User_Name Password \n\n";
my $remote_host_ip = $ARGV[0];
my $port = $ARGV[1] ;
my $username = $ARGV[2] ;
my $password = $ARGV[3] ;
my $recv_file_name = $ARGV[4] ;
my $first_cmd ="cd /tellin/oams/oams_run/log";
my $second_cmd = "ps -ef|grep -v grep|grep tail|awk '{print $2}'|xargs kill -9";
my $third_cmd = "tail -f /tellin/oams/oams_run/log/oams_warninglog_usr.log";
print "ip

print "port

print "login

print "passwd

my $telnet_hd=new Net::Telnet (Timeout => 3600);
print "now telnet......\n";
#$telnet_hd->open(Host=>$remote_host_ip);
$telnet_hd->open(Host=>$remote_host_ip,Port=>$port);
print "now open ......\n";
$telnet_hd->login(login=>$username,Password=>$password);
print "now login......\n";
执行perl程序的时候提示如下,哪位帮忙看看是啥问题啊?
Usage: get_alarm.pl remote_host_ip port User_Name Password
ip:192.168.1.149
port:23
name

passwd

now telnet......
now open ......
手工telnet服务器的时候
telnet 192.168.1.149
Trying 192.168.1.149...
Connected to 192,168.1.149.
Escape character is '^]'.
Welcome to SUSE Linux Enterprise Server 10 SP1 (x86_64) - Kernel 2.6.16.46-0.12-smp (2).
linux-461u login:
作者: liuxiaozhe 发布时间: 2010-12-31
你的prompt 在哪?
作者: meihuaqi 发布时间: 2010-12-31
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28