- Community Home
- >
- Networking
- >
- Legacy
- >
- Switches, Hubs, Modems
- >
- Re: using perl Net::Telnet module with HP procurve
Switches, Hubs, and Modems
1753403
Members
7600
Online
108792
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
тАО04-12-2005 09:26 PM
тАО04-12-2005 09:26 PM
using perl Net::Telnet module with HP procurve
hello,
i'm trying to use the Net::Telnet module to query procurve 2524 switch, but it seems that no data are sent to the switch and i've no output data back from sent commands. does anybody success to query procurve switch ? if so can you send me an example of telnets session and how to take back results of commands ?
thank you.
my try :
#!/usr/bin/perl
use Net::Telnet;
my $session = new Net::Telnet ( Timeout=>5, Telnetmode=>0);
my $output = $session->open('192.168.1.10');
print $output;
$session->waitfor('/password $/i');
$output = $session->print('xxxxxxxxx');
print $output;
$output = $session->print('terminal length 1000');
print $output;
$output = $session->print('show version');
print $output;
$ perl hp.pl
pattern match timed-out at hp.pl line 8
i'm trying to use the Net::Telnet module to query procurve 2524 switch, but it seems that no data are sent to the switch and i've no output data back from sent commands. does anybody success to query procurve switch ? if so can you send me an example of telnets session and how to take back results of commands ?
thank you.
my try :
#!/usr/bin/perl
use Net::Telnet;
my $session = new Net::Telnet ( Timeout=>5, Telnetmode=>0);
my $output = $session->open('192.168.1.10');
print $output;
$session->waitfor('/password $/i');
$output = $session->print('xxxxxxxxx');
print $output;
$output = $session->print('terminal length 1000');
print $output;
$output = $session->print('show version');
print $output;
$ perl hp.pl
pattern match timed-out at hp.pl line 8
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 08:21 AM
тАО05-10-2005 08:21 AM
Re: using perl Net::Telnet module with HP procurve
I have not used perl to gather this data. I have been able to get 'expect' to work. Is this an option for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2005 08:33 PM
тАО05-10-2005 08:33 PM
Re: using perl Net::Telnet module with HP procurve
Hi,
* On line 8, $session->waitfor('/password $/i'), "password $" mean the script wait
for "password" + SPACE + RETURN. I'm sure there is a ":" in the HP prompt.
You can try a string like "/password/i" or "/password.*$/" or "/password :/i".
* You should use a "waitfor" for the prompt after a print :
--> $session->waitfor(String => '#');
Some other tips :
- For debuging telnet scripts, a sniffer is very usefull (like ethereal).
- You should handle open failed sessions.
- To disable page mode you could use 'terminal length 0'.
Bye,
* On line 8, $session->waitfor('/password $/i'), "password $" mean the script wait
for "password" + SPACE + RETURN. I'm sure there is a ":" in the HP prompt.
You can try a string like "/password/i" or "/password.*$/" or "/password :/i".
* You should use a "waitfor" for the prompt after a print :
--> $session->waitfor(String => '#');
Some other tips :
- For debuging telnet scripts, a sniffer is very usefull (like ethereal).
- You should handle open failed sessions.
- To disable page mode you could use 'terminal length 0'.
Bye,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2011 07:06 AM
тАО04-04-2011 07:06 AM
Re: using perl Net::Telnet module with HP procurve
i use Netcat
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