Welcome to the monastery. There are several modules on cpan which you could use to connect to the switch, depending on which services it runs, Net::Telnet or Net::SSH2. This isn't a code writing service (see PerlMonks for the Absolute Beginner). There are many posts which already cover this topic. Super search will help track them down.
Update: please don't down vote new users.
| [reply] |
I see "show running-config" and assume you mean a Cisco switch. If that's right, Net::Telnet::Cisco is a great place to start.
If you don't want to reinvent the wheel and can deal with a script that does A LOT MORE than just Telnet to Cisco switches, have a look at (shameless plug) Cisco Router Action Performing Perl Script
| [reply] |
Welcome to the Monastery!
need help to connect switch 192.168.1.2 using perl script.
What switch are you talking about? What protocol does it use? SNMP? Telnet? SSH?
In perl script I want to use module (which i need to create) to reuse the code.
It's not necessary to create a module to resue the code, but anyway, read perlmod, perlnewmod, perlmodlib.
After connecting switch I need to excute "show running-config" and get the output.
I guess that this is a CISCO switch, right? You should have mentioned it (see How do I post a question effectively?). Try using some modules from CPAN.
Please provide me the script
Is PM a good place to get answers for homework?
Sorry if my advice was wrong.
| [reply] |