Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

How to automatize a specific task by using a script type procedure !!!

Hi Netpros,

Ideally what I am trying to do is to collect interface stats periodically and damp that info in to a file which can then be reviewed later at the end of the day.

The 'script' pseudo code will look something like this:

1.- At a specific time, from a management PC start a ssh session to router A

2.- perform some specific commands

3.- dump the output in to file A.txt (if the file already exist, then add that information to the existing file and save the changes.

4.- finish the session

5.- After specific time .. go back to point 1.

How can I do this without using management tools such as LMS .. etc.

Your feedback is much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: How to automatize a specific task by using a script type pro

Depending on the version of IOS on this device, you could script this entirely on the router using either TCL+kron or the Embedded Event Manager. You could then have the router keep this data in flash, or transfer it to a network server. For details on TCL in IOS can be found at http://www.cisco.com/en/US/products/sw/iosswrel/ps5207/products_feature_guide09186a00801a75a7.html and EEM details can be found at http://www.cisco.com/en/US/products/ps6441/products_configuration_guide_chapter09186a00807c676c.html .

If you wanted to use an external management machine, and you need to use SSH, your best bet is to go with Expect as there aren't too many good SSH scripting libraries. See http://expect.nist.gov/ for more details on expect.

For scheduling this to happen on Windows, look at using "at" (the command scheduler). For UNIX, you can use cron.

2 REPLIES
Cisco Employee

Re: How to automatize a specific task by using a script type pro

Depending on the version of IOS on this device, you could script this entirely on the router using either TCL+kron or the Embedded Event Manager. You could then have the router keep this data in flash, or transfer it to a network server. For details on TCL in IOS can be found at http://www.cisco.com/en/US/products/sw/iosswrel/ps5207/products_feature_guide09186a00801a75a7.html and EEM details can be found at http://www.cisco.com/en/US/products/ps6441/products_configuration_guide_chapter09186a00807c676c.html .

If you wanted to use an external management machine, and you need to use SSH, your best bet is to go with Expect as there aren't too many good SSH scripting libraries. See http://expect.nist.gov/ for more details on expect.

For scheduling this to happen on Windows, look at using "at" (the command scheduler). For UNIX, you can use cron.

Re: How to automatize a specific task by using a script type pro

Great .. Appreciate your comments .. I will definitely have a look at your links ...

Cheers

117
Views
10
Helpful
2
Replies