Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cisco: NSP

How to run script file from flash

 

 

Cisco nsp RSS feed   Index | Next | Previous | View Threaded


jneiberger at gmail

Aug 27, 2010, 8:31 AM

Post #1 of 4 (2486 views)
Permalink
How to run script file from flash

I have a set of complicated commands that I need to run periodically
on several modules on a bunch of routers. I'd like to create a text
file of the commands and store it on the flash of each router, then
just run the commands from the text file stored on the router. I know
we can use "more" to view the file, but since this will just be a file
of show commands, is there a way to have the script run as if I were
entering the commands myself? It would save me a lot of time if I
could just run the script from the CLI.

Thanks!
John
_______________________________________________
cisco-nsp mailing list cisco-nsp [at] puck
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/


vijay.ramcharan at verizonbusiness

Aug 27, 2010, 9:45 AM

Post #2 of 4 (2426 views)
Permalink
Re: How to run script file from flash [In reply to]

> -----Original Message-----
> From: cisco-nsp-bounces [at] puck
[mailto:cisco-nsp-bounces [at] puck] On
> Behalf Of John Neiberger
> Sent: Friday, August 27, 2010 11:32 AM
> To: cisco-nsp [at] puck
> Subject: [c-nsp] How to run script file from flash
>
> I have a set of complicated commands that I need to run periodically
> on several modules on a bunch of routers. I'd like to create a text
> file of the commands and store it on the flash of each router, then
> just run the commands from the text file stored on the router. I know
> we can use "more" to view the file, but since this will just be a file
> of show commands, is there a way to have the script run as if I were
> entering the commands myself? It would save me a lot of time if I
> could just run the script from the CLI.
>
> Thanks!
> John
> _______________________________________________
> cisco-nsp mailing list cisco-nsp [at] puck
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/


It should be possible.
See
http://blog.ioshints.info/2007/08/example-tcl-script-with-command-line.h
tml for a short example.
Other links:
http://wiki.nil.com/Executing_IOS_commands_from_Tcl_shell
http://jelonek.info/doku/doku.php?id=network:scripts

I had no idea that there was a whole book just for TCL scripting on IOS.

http://www.amazon.com/TcL-Scripting-Cisco-Networking-Technology/dp/15870
59452/ref=sr_1_1?ie=UTF8&s=books&qid=1282927176&sr=8-1

Vijay Ramcharan

_______________________________________________
cisco-nsp mailing list cisco-nsp [at] puck
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/


ploopster at gmail

Aug 27, 2010, 9:50 AM

Post #3 of 4 (2422 views)
Permalink
Re: How to run script file from flash [In reply to]

John Neiberger wrote:
> I have a set of complicated commands that I need to run periodically
> on several modules on a bunch of routers. I'd like to create a text
> file of the commands and store it on the flash of each router, then
> just run the commands from the text file stored on the router. I know
> we can use "more" to view the file, but since this will just be a file
> of show commands, is there a way to have the script run as if I were
> entering the commands myself? It would save me a lot of time if I
> could just run the script from the CLI.

man 1 expect

Peace... Sridhar
_______________________________________________
cisco-nsp mailing list cisco-nsp [at] puck
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/


andrea.montefusco at gmail

Aug 27, 2010, 9:50 AM

Post #4 of 4 (2422 views)
Permalink
Re: How to run script file from flash [In reply to]

John Neiberger wrote:
> I have a set of complicated commands that I need to run periodically
> on several modules on a bunch of routers. I'd like to create a text
> file of the commands and store it on the flash of each router, then
> just run the commands from the text file stored on the router. I know
> we can use "more" to view the file, but since this will just be a file
> of show commands, is there a way to have the script run as if I were
> entering the commands myself? It would save me a lot of time if I
> could just run the script from the CLI.

You could create a new IOS command with Tcl and run it manually or
time (like Unix cron).
Take a look at

http://wiki.nil.com/Executing_IOS_commands_from_Tcl_shell
http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6555/ps6815/config_guide_eem_configuration_for_cisco_integrated_services_router_platforms.html

*am*

---------------------------------------------------------
Andrea Montefusco iw0hdv http://www.montefusco.com
tel: +393356992791 fax: +390623318709
---------------------------------------------------------
_______________________________________________
cisco-nsp mailing list cisco-nsp [at] puck
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/

Cisco nsp RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.