Home > Archive > alt.certification.cisco > February 2004 > Perl Scripting





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Perl Scripting
Ryan

2004-02-25, 2:25 am

Ive recently picked up the Cisco Cookbook from Oreilly Press and looked over
the brief sections where Perl scripts are implemented for various tasks when
managing Cisco Based Networks. Im a newbie to Perl but looks to me like it
can be a very useful tool. I know there is a google search but can anyone
recommend a good site to get, look at, or learn some scripts.

Oh Yeah, I picked up "Learning Perl" from OReilly books and will go through
to get a foundation on the language. Was this a good start? Are there highly
recommended books out there for this?

Pretty cool stuff, cant wait to deploy my first script on a live
environment. I help manage over 170 devices so this stuff can really help.
Thanks for any info you all may hand down to me.

Ryan.


GPLama

2004-02-25, 3:25 am

This is what you are looking for http://nettelnetcisco.sourceforge.net/

I have made some example scripts, and will be writing a how-to guide for
people who need a helping hand getting the correct Perl libraries installed
etc..

Once the environment is setup, its as simple as;

#!/usr/bin/perl
use Net::Telnet::Cisco;
my $session = Net::Telnet::Cisco->new(Host => '192.168.0.100');
$session->login('', 'HIDDEN');
# Execute a command
my @output = $session->cmd('sh env all');
rint @output;
$session->close;


regards,
GPL



"Ryan" <ryan@no-mail.com> wrote in message
news:qHX_b.2482$Bb5.2337@twister.socal.rr.com...
> Ive recently picked up the Cisco Cookbook from Oreilly Press and looked

over
> the brief sections where Perl scripts are implemented for various tasks

when
> managing Cisco Based Networks. Im a newbie to Perl but looks to me like it
> can be a very useful tool. I know there is a google search but can anyone
> recommend a good site to get, look at, or learn some scripts.
>
> Oh Yeah, I picked up "Learning Perl" from OReilly books and will go

through
> to get a foundation on the language. Was this a good start? Are there

highly
> recommended books out there for this?
>
> Pretty cool stuff, cant wait to deploy my first script on a live
> environment. I help manage over 170 devices so this stuff can really help.
> Thanks for any info you all may hand down to me.
>
> Ryan.
>
>



2004-02-26, 1:25 am

Perl rocks! The Oreilly books are good, but not really good learning books.
Its hard to say which is best for you, if I had to start over I would buy
"Perl for Dummies" for the basics and "Perl Black Book" for the gory
details. I don't think the Black book is still in production, but its about
$6 on ebay.

Kristopher


"Ryan" <ryan@no-mail.com> wrote in message
news:qHX_b.2482$Bb5.2337@twister.socal.rr.com...
> Ive recently picked up the Cisco Cookbook from Oreilly Press and looked

over
> the brief sections where Perl scripts are implemented for various tasks

when
> managing Cisco Based Networks. Im a newbie to Perl but looks to me like it
> can be a very useful tool. I know there is a google search but can anyone
> recommend a good site to get, look at, or learn some scripts.
>
> Oh Yeah, I picked up "Learning Perl" from OReilly books and will go

through
> to get a foundation on the language. Was this a good start? Are there

highly
> recommended books out there for this?
>
> Pretty cool stuff, cant wait to deploy my first script on a live
> environment. I help manage over 170 devices so this stuff can really help.
> Thanks for any info you all may hand down to me.
>
> Ryan.
>
>



Ryan

2004-02-26, 1:25 am

Right on, I got it bookmarked at home and work. For my first test, I want to
write a
script that will give me a printout of all the ports on several devices
that triggered port security.
If it goes well, Ill run it every morning when I come in for work.

Thanks for the help and look forward to watching your site grow.

Ryan.

"GPLama" <gplamaRE@MOVEiinetTHIS.n3t.au> wrote in message
news:403c4cc8$1_3@news.melbourne.pipenetworks.com...
> This is what you are looking for http://nettelnetcisco.sourceforge.net/
>
> I have made some example scripts, and will be writing a how-to guide for
> people who need a helping hand getting the correct Perl libraries

installed
> etc..
>
> Once the environment is setup, its as simple as;
>
> #!/usr/bin/perl
> use Net::Telnet::Cisco;
> my $session = Net::Telnet::Cisco->new(Host => '192.168.0.100');
> $session->login('', 'HIDDEN');
> # Execute a command
> my @output = $session->cmd('sh env all');
> rint @output;
> $session->close;
>
>
> regards,
> GPL
>
>
>
> "Ryan" <ryan@no-mail.com> wrote in message
> news:qHX_b.2482$Bb5.2337@twister.socal.rr.com...
> over
> when
it[color=blue]
anyone[color=blue]
> through
> highly
help.[color=blue]
>
>



joe

2004-02-26, 8:25 pm

On Thu, 26 Feb 2004 05:24:19 GMT, "Ryan" <ryan@no-mail.com> wrote:

>Right on, I got it bookmarked at home and work. For my first test, I want to
>write a
> script that will give me a printout of all the ports on several devices
>that triggered port security.
>If it goes well, Ill run it every morning when I come in for work.
>
>Thanks for the help and look forward to watching your site grow.
>
>Ryan.


You could use a free utility called nmap for this task. Include it
within a Perl script to redirect the output to a custom file. I do
this weekly. Very handy for catching open ports or IP addresses
in use that are unauthorized.

Nmap's home is at : http://www.insecure.org/nmap/

cheers,
joe
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net