- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl - Not Getting Output
Operating System - HP-UX
1753815
Members
8077
Online
108805
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
тАО09-16-2008 02:55 AM
тАО09-16-2008 02:55 AM
Perl - Not Getting Output
Hi All,
Following Code is executes well without any issue...but doesn't do its job. I have checked the logs as well but it doesn't perform its task. Will be very helpful if you can identify the issue with it...
fyi - I am trying to take configuration backup of a switch to a ftp machine.
###############################################
use Net::Telnet;
my $filename = "dump.log";
my $file = "input.log";
$telnet = new Net::Telnet ( Timeout=>5,Errmode=>'die',Prompt => '/.*>/',Dump_Log
=> $filename,Input_log => $file);
$telnet->open('10.25.4.11');
$telnet->login('admin','password');
$telnet->print('configupload');
$telnet->waitfor('/.*: $/i');
$telnet->print('ftp');
$telnet->waitfor('/.*: $/i');
$telnet->print('abemr012');#hostname
$telnet->waitfor('/.*: $/');
$telnet->print('10.18.15.53');#host ip addr
$telnet->waitfor('/.*: $/');
$telnet->print('admin');#ftp uid
$telnet->waitfor('/.*: $/');
$telnet->print('temp.txt');#file name for bkp
$telnet->waitfor('/.*: $/');
$telnet->print('password');#admin uid passwd
print $telnet->waitfor('/.*/');#prints 1, and doesn't perform its task as well.
Any help is appreciated!
Following Code is executes well without any issue...but doesn't do its job. I have checked the logs as well but it doesn't perform its task. Will be very helpful if you can identify the issue with it...
fyi - I am trying to take configuration backup of a switch to a ftp machine.
###############################################
use Net::Telnet;
my $filename = "dump.log";
my $file = "input.log";
$telnet = new Net::Telnet ( Timeout=>5,Errmode=>'die',Prompt => '/.*>/',Dump_Log
=> $filename,Input_log => $file);
$telnet->open('10.25.4.11');
$telnet->login('admin','password');
$telnet->print('configupload');
$telnet->waitfor('/.*: $/i');
$telnet->print('ftp');
$telnet->waitfor('/.*: $/i');
$telnet->print('abemr012');#hostname
$telnet->waitfor('/.*: $/');
$telnet->print('10.18.15.53');#host ip addr
$telnet->waitfor('/.*: $/');
$telnet->print('admin');#ftp uid
$telnet->waitfor('/.*: $/');
$telnet->print('temp.txt');#file name for bkp
$telnet->waitfor('/.*: $/');
$telnet->print('password');#admin uid passwd
print $telnet->waitfor('/.*/');#prints 1, and doesn't perform its task as well.
Any help is appreciated!
- Tags:
- Perl
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-16-2008 04:23 AM
тАО09-16-2008 04:23 AM
Re: Perl - Not Getting Output
Hi:
It would seem that if an FTP is the objective, using 'Net::FTP' would be the desirable approach.
That said, the FTP dialog that you are trying to establish doesn't look valid. You issue a bare "ftp" command; wait for a response; and then supply a hostname without preceding it with the 'open' command. This is going to fail. You do similar things as your dialog proceeds.
Regards!
...JRF...
It would seem that if an FTP is the objective, using 'Net::FTP' would be the desirable approach.
That said, the FTP dialog that you are trying to establish doesn't look valid. You issue a bare "ftp" command; wait for a response; and then supply a hostname without preceding it with the 'open' command. This is going to fail. You do similar things as your dialog proceeds.
Regards!
...JRF...
- Tags:
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-16-2008 07:27 PM
тАО09-16-2008 07:27 PM
Re: Perl - Not Getting Output
Hi,
Actually I am connecting to switch via perl script from my local pc. Now switch itself provides functionality to takes its configuration backup to a ftp server. We need not have to open saperate connection from switch to ftp server. Hence I think we need not have to use ::FTP. Any suggestions?
Actually I am connecting to switch via perl script from my local pc. Now switch itself provides functionality to takes its configuration backup to a ftp server. We need not have to open saperate connection from switch to ftp server. Hence I think we need not have to use ::FTP. Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2008 05:12 AM
тАО09-17-2008 05:12 AM
Re: Perl - Not Getting Output
Hi (again):
Regardless of from where you want to fetch your file, the simplest method (IMO) is to use Perl's Net::FTP. This will be a simple, direct way to achieve your goal.
Regards!
...JRF...
Regardless of from where you want to fetch your file, the simplest method (IMO) is to use Perl's Net::FTP. This will be a simple, direct way to achieve your goal.
Regards!
...JRF...
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