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

Martin Clifton Martin.Clifton at vu.edu.au
Sat Nov 27 05:08:33 EST 2010


If you can't use SNMP or don't want to use expect, then another method
which is available on the Catalyst 3750 (can't vouch for other platforms)
is to push information out via tftp.

sh int | redirect tftp://<tftp-server>/<file-name>

This can be put in a cron job (called kron by cisco) so that the info can
be sent on a regular basis.
eg to push out the result of 'sh int' every 10 minutes:

kron policy-list DO-SOMETHING
 cli sh int | redirect tftp://<tftp-server>/<file-name>
kron occurrence DO-SOMETHING-REGULARLY in 10 recurring
 policy-list DO-SOMETHING

Then you just need a script on the tftp-server to parse the received file
and put it in a form that suits.

Martin




On 27/11/10 3: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.
>
>Any thoughts?
>_______________________________________________
>cisco-nsp mailing list  cisco-nsp at puck.nether.net
>https://puck.nether.net/mailman/listinfo/cisco-nsp
>archive at http://puck.nether.net/pipermail/cisco-nsp/

This email, including any attachment, is intended solely for the use of the intended recipient. It is confidential and may contain personal information or be subject to legal professional privilege. If you are not the intended recipient any use, disclosure, reproduction or storage of it is unauthorised. If you have received this email in error, please advise the sender via return email and delete it from your system immediately. Victoria University does not warrant that this email is free from viruses or defects and accepts no liability for any damage caused by such viruses or defects.



More information about the cisco-nsp mailing list