Advertisement

08.24.2006 at 08:25PM PDT, ID: 21966974
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

500pts - Use Net::Telnet and be able to look for "<-- MORE -->"

Tags: perl, telnet
Here is the code I am using, I am looking for a way to get pass the "<-- MORE -->".
The device happens to be a Cisco Pix Firewall, I know there are other cisco telnet perl modules, however they support IOS only which mean Cisco routers - not the Cisco Pix firewall.


Thanks,
Mark

********
#http://search.cpan.org/~jrogers/Net-Telnet-3.03/lib/Net/Telnet.pm

 use Net::Telnet;
 $telnet = new Net::Telnet ( Timeout=>10,
                             Errmode=>'die');
                             
                             
$telnet = new Net::Telnet( Timeout      => 10,
                            Errmode=>'die',
                          ,Dump_log     => 'dump.log'
                          ,Input_log    => 'input.log'
                          ,Output_log   => 'output.log');

                             
 $telnet->open('192.168.1.250');
 $telnet->waitfor('/password: $/i');
 $telnet->print('telnet-password');


 $telnet->waitfor('/mypix> $/i');
 $telnet->print('en');                        
 
 $telnet->waitfor('/password: $/i');
 $telnet->print('en-password');
 
 
 $output = $telnet->waitfor('/mypix# $/i');
 $telnet->print('show config');

****************
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: markpalinux
Solution Provided By: jmcg
Participating Experts: 4
Solution Grade: A
Views: 4
Translate:
Loading Advertisement...
08.25.2006 at 03:15AM PDT, ID: 17388215

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.25.2006 at 04:12AM PDT, ID: 17388439

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.25.2006 at 06:08AM PDT, ID: 17389069

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.25.2006 at 08:04AM PDT, ID: 17390095

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.25.2006 at 08:48AM PDT, ID: 17390483

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.25.2006 at 09:34AM PDT, ID: 17390880

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.25.2006 at 09:41AM PDT, ID: 17390939

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
08.25.2006 at 09:44PM PDT, ID: 17394563

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.03.2006 at 10:17PM PDT, ID: 17657091

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.05.2006 at 08:07AM PDT, ID: 17669364

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.05.2006 at 08:29AM PDT, ID: 17669573

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
08.25.2006 at 03:15AM PDT, ID: 17388215

Rank: Genius

where do you get the "<-- MORE -->"?
 
08.25.2006 at 04:12AM PDT, ID: 17388439

Rank: Sage

What would you do to get past <--MORE--> in a live telnet session?
 
08.25.2006 at 06:08AM PDT, ID: 17389069

if you do a "ls -l | more" on a linux box.

in a live telnet session you would press the space bar.

Thanks,
Mark
 
08.25.2006 at 08:04AM PDT, ID: 17390095

Rank: Sage

I would look at the Net::Telnet::Cisco (http://search.cpan.org/~joshua/Net-Telnet-Cisco-1.10/Cisco.pm) module, and see  how the More prompt is handled by Cisco.pm; it should be adaptable to what you want to do.

I think it's going to require setting the prompt:

$telnet->prompt("/<-- MORE -->/");

and then sending a space:

$telnet->cmd(' ');

or perhaps printing a space:

$telnet->print(' ');

but I have no way to test this out...
Assisted Solution
 
08.25.2006 at 08:48AM PDT, ID: 17390483

Rank: Genius

I wouldn't think you would use |more when using net::telnet.  If you wanted to get a list of files, your perl script could process all the files, you wouldn't need to use |more, because you don't have a screen.
Assisted Solution
 
08.25.2006 at 09:34AM PDT, ID: 17390880

Rank: Sage

I think what's happening is that the router/firewall sends the data from $telnet->print('show config') to the screen in such a way that the --MORE-- delay is used, as the data is greater than a screenful.  Another example of one of those great features that you wish you could shut off...:)
 
08.25.2006 at 09:41AM PDT, ID: 17390939
mjcoyne - you are correct --MORE-- is coming from the router, as it is a screenful.

I will try what you suggested above and will let you know the results.

Thanks,
Mark
 
08.25.2006 at 09:44PM PDT, ID: 17394563

Rank: Sage

Changing the prompt to match the "MORE" string will help if you know that will be the next prompt. I expect there will be situations where you don't know whether the next prompt will be a "MORE" or the end of the list. In this case, I think you'd need to move away from using the 'cmd' method and use the print/waitfor methods. The 'waitfor' method allows you to specify more than one string or pattern that is to be waited for. You have to test which match occurred to decide what to do next.
Accepted Solution
 
10.03.2006 at 10:17PM PDT, ID: 17657091

Rank: Sage

markpalinux -

This old question needs to be finalized — accept an answer, split points, or get a refund.  For information on your options, please see

http://www.experts-exchange.com/help.jsp#hs5

Once more than 21 days have passed with no new responses posted, a question is considered abandoned.  If you do nothing, I will make a recommendation to the moderators on its resolution in approximately 4 to 14 days.

 EXPERTS -  I would appreciate any comments that would help me in making a recommendation.

jmcg
EE Page Editor for Perl wearing my Cleanup hat
 
10.05.2006 at 08:07AM PDT, ID: 17669364

What I come to find out is that rather then use the 'show config' it was better to use the routers or switches command line to use tftp and have the config of the device be sent there.

Still wish I could have found an answer for --more-- though.

Thanks,
Mark
 
10.05.2006 at 08:29AM PDT, ID: 17669573

Rank: Genius

The answer from jmcg doesn't work with --more--?

Using his suggestion, you wouldn't use the cmd function to send commands, you would use a combination of print and waitfor.  The waitfor would wait for either the --more-- or the next command prompt.  If it saw --more--, it would send another print to get the next screenful.  If it saw the next command prompt, it would know the command had finished.  You could even put this new stuff in a new function, so it could be used from your app just like the cmd function... for example, call it cmd_with_more.
 
 
20080716-EE-VQP-33