[c-nsp] How to run a scheduled script to grab interface stats

Lee ler762 at gmail.com
Fri Nov 26 23:47:04 EST 2010


On 11/26/10, Andrew Wentzell <awentzell at gmail.com> wrote:
> On Fri, Nov 26, 2010 at 11:43 AM, John Neiberger <jneiberger at gmail.com>
> wrote:
>> I'd like to periodically (weekly, for example) gather certain
>> interface stats via "show int" and then upload those stats via
>> ftp/tftp/scp or whatever to a server. I'll then pull those stats into
>> an Excel spreadsheet and parse them. What would be the best way to do
>> this? Is this something that can be built in a TCL script and then run
>> on a schedule? If you needed to do this, how would you do it? I have
>> stats from multiple interfaces on six 7600s that I need to grab at
>> least once a week.
>
> I'd write an expect script to run the show command, then parse the
> output with perl/python (or just write the whole thing in python and
> use the pexpect module).  Dump all the data to a CSV file or whatever
> you want. Run via a cron job as often as needed.

The folks at shrubbery.net have already written the expect script;
install rancid &

clogin -c "sh int" devname | awk/perl/python ...

regards,
lee


More information about the cisco-nsp mailing list