- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- connect to a remote server through perlscript
Operating System - HP-UX
1753939
Members
9877
Online
108811
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2007 12:15 AM
тАО10-04-2007 12:15 AM
connect to a remote server through perlscript
Hello,
try to build a perl-script that execute some commands on a remote server. I use the module NET::Telnet.
When I run my script i recieve the follow error:
[u51cf28:/home/u7514756/Scripts]# ./SysInfo.pl timed-out waiting for command prompt at ./SysInfo.pl line 22 [u51cf28:/home/u7514756/Scripts]#
bu I look at the debug files ... it seems that everything goes right :
Debug:
< 0x00000: ff fd 24 ├┐├╜$
> 0x00000: ff fc 24 ├┐├╝$
< 0x00000: ff fd 18 ├┐├╜.
> 0x00000: ff fc 18 ├┐├╝.
< 0x00000: ff fe 18 ff fd 20 ├┐├╛.├┐├╜
> 0x00000: ff fc 20 ├┐├╝
< 0x00000: ff fe 20 ff fb 01 ff fb 03 ff fd 1f ff fd 21 ff ├┐├╛ ├┐├╗.├┐├╗.├┐├╜.├┐├╜!├┐ < 0x00010: fd 01 0d 0a 48 50 2d 55 58 20 75 39 31 63 39 61 ├╜...HP-UX u91c9a < 0x00020: 30 20 42 2e 31 31 2e 31 31 20 55 20 39 30 30 30 0 B.11.11 U 9000
< 0x00030: 2f 38 30 30 20 28 74 62 29 0d 0a 0d 0a /800 (tb)....
> 0x00000: ff fd 01 ff fd 03 ff fc 1f ff fc 21 ff fc 01 ├┐├╜.├┐├╜.├┐├╝.├┐├╝!├┐├╝.
< 0x00000: ff fe 1f ff fe 21 ff fe 01 ├┐├╛.├┐├╛!├┐├╛.
< 0x00000: 6c 6f 67 69 6e 3a 20 login:
> 0x00000: 75 37 35 31 34 37 35 36 0d 0a u7514756..
< 0x00000: 75 37 35 31 34 37 35 36 0d 0a u7514756..
< 0x00000: 50 61 73 73 77 6f 72 64 3a 20 Password:
> 0x00000: 6c 75 6e 61 32 30 30 37 0d 0a pipo..
< 0x00000: 0d 0a ..
< 0x00000: 50 6c 65 61 73 65 20 77 61 69 74 2e 2e 2e 63 68 Please wait...ch < 0x00010: 65 63 6b 69 6e 67 20 66 6f 72 20 64 69 73 6b 20 ecking for disk
< 0x00020: 71 75 6f 74 61 73 0d 0a quotas..
< 0x00000: 54 45 52 4d 20 3d 20 28 68 70 29 20 TERM = (hp)
And inputfile:
HP-UX u91c9a0 B.11.11 U 9000/800 (tb)
login: u7514756
Password:
Please wait...checking for disk quotas
TERM = (hp)
Here is my script again with the extra otions:
use strict;
use Net::Telnet ();
# variables
my $t;
my $username = "u7514756";
my $passwd = "pipo";
my @lines;
chomp($username);
chomp($passwd);
#$t = Net::Telnet->new(Timeout => 30);
$t = Net::Telnet->new (Port => 23,
Timeout => 30,
Input_log => "/tmp/input_jonay",
Dump_log => "/tmp/dump_jonay");
$t->open("u91c9a0.cmc.be");
$t->login("$username", "$passwd");
$t->waitfor(String => '>');
$t->print('who');
#@lines = $t->cmd("who");
#print @lines;
[u51cf28:/home/u7514756/Scripts]#
what goes wrong ?
thanks in advance,
Jonay Herrera
try to build a perl-script that execute some commands on a remote server. I use the module NET::Telnet.
When I run my script i recieve the follow error:
[u51cf28:/home/u7514756/Scripts]# ./SysInfo.pl timed-out waiting for command prompt at ./SysInfo.pl line 22 [u51cf28:/home/u7514756/Scripts]#
bu I look at the debug files ... it seems that everything goes right :
Debug:
< 0x00000: ff fd 24 ├┐├╜$
> 0x00000: ff fc 24 ├┐├╝$
< 0x00000: ff fd 18 ├┐├╜.
> 0x00000: ff fc 18 ├┐├╝.
< 0x00000: ff fe 18 ff fd 20 ├┐├╛.├┐├╜
> 0x00000: ff fc 20 ├┐├╝
< 0x00000: ff fe 20 ff fb 01 ff fb 03 ff fd 1f ff fd 21 ff ├┐├╛ ├┐├╗.├┐├╗.├┐├╜.├┐├╜!├┐ < 0x00010: fd 01 0d 0a 48 50 2d 55 58 20 75 39 31 63 39 61 ├╜...HP-UX u91c9a < 0x00020: 30 20 42 2e 31 31 2e 31 31 20 55 20 39 30 30 30 0 B.11.11 U 9000
< 0x00030: 2f 38 30 30 20 28 74 62 29 0d 0a 0d 0a /800 (tb)....
> 0x00000: ff fd 01 ff fd 03 ff fc 1f ff fc 21 ff fc 01 ├┐├╜.├┐├╜.├┐├╝.├┐├╝!├┐├╝.
< 0x00000: ff fe 1f ff fe 21 ff fe 01 ├┐├╛.├┐├╛!├┐├╛.
< 0x00000: 6c 6f 67 69 6e 3a 20 login:
> 0x00000: 75 37 35 31 34 37 35 36 0d 0a u7514756..
< 0x00000: 75 37 35 31 34 37 35 36 0d 0a u7514756..
< 0x00000: 50 61 73 73 77 6f 72 64 3a 20 Password:
> 0x00000: 6c 75 6e 61 32 30 30 37 0d 0a pipo..
< 0x00000: 0d 0a ..
< 0x00000: 50 6c 65 61 73 65 20 77 61 69 74 2e 2e 2e 63 68 Please wait...ch < 0x00010: 65 63 6b 69 6e 67 20 66 6f 72 20 64 69 73 6b 20 ecking for disk
< 0x00020: 71 75 6f 74 61 73 0d 0a quotas..
< 0x00000: 54 45 52 4d 20 3d 20 28 68 70 29 20 TERM = (hp)
And inputfile:
HP-UX u91c9a0 B.11.11 U 9000/800 (tb)
login: u7514756
Password:
Please wait...checking for disk quotas
TERM = (hp)
Here is my script again with the extra otions:
use strict;
use Net::Telnet ();
# variables
my $t;
my $username = "u7514756";
my $passwd = "pipo";
my @lines;
chomp($username);
chomp($passwd);
#$t = Net::Telnet->new(Timeout => 30);
$t = Net::Telnet->new (Port => 23,
Timeout => 30,
Input_log => "/tmp/input_jonay",
Dump_log => "/tmp/dump_jonay");
$t->open("u91c9a0.cmc.be");
$t->login("$username", "$passwd");
$t->waitfor(String => '>');
$t->print('who');
#@lines = $t->cmd("who");
#print @lines;
[u51cf28:/home/u7514756/Scripts]#
what goes wrong ?
thanks in advance,
Jonay Herrera
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2007 12:29 AM
тАО10-04-2007 12:29 AM
Re: connect to a remote server through perlscript
Hi:
Are you sure that you are waiting for the correct response? You are waiting for a '>' in the code you posted.
Regards!
...JRF...
Are you sure that you are waiting for the correct response? You are waiting for a '>' in the code you posted.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2007 12:36 AM
тАО10-04-2007 12:36 AM
Re: connect to a remote server through perlscript
thanks for the quik answer,
But even without the waitfor option didn't work.
I have change it in "#" but even with that didn't work.
thanks anyway,
Jonay
But even without the waitfor option didn't work.
I have change it in "#" but even with that didn't work.
thanks anyway,
Jonay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2007 12:54 AM
тАО10-04-2007 12:54 AM
Re: connect to a remote server through perlscript
Hi,
I modified your script in this way:
use strict;
use Net::Telnet ();
# variables
my $t;
my $username = "u7514756";
my $passwd = "pipo";
my @lines;
chomp($username);
chomp($passwd);
#$t = Net::Telnet->new(Timeout => 30);
$t = Net::Telnet->new (Port => 23,
Timeout => 30,
Input_log => "/tmp/input_jonay",
Dump_log => "/tmp/dump_jonay");
$t->open("u91c9a0.cmc.be");
$t->login("$username", "$passwd");
#$t->waitfor(String => '>');
$t->print('who');
@lines = $t->cmd("who");
print @lines;
and run correctly.
Fat
I modified your script in this way:
use strict;
use Net::Telnet ();
# variables
my $t;
my $username = "u7514756";
my $passwd = "pipo";
my @lines;
chomp($username);
chomp($passwd);
#$t = Net::Telnet->new(Timeout => 30);
$t = Net::Telnet->new (Port => 23,
Timeout => 30,
Input_log => "/tmp/input_jonay",
Dump_log => "/tmp/dump_jonay");
$t->open("u91c9a0.cmc.be");
$t->login("$username", "$passwd");
#$t->waitfor(String => '>');
$t->print('who');
@lines = $t->cmd("who");
print @lines;
and run correctly.
Fat
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP