Cron for show proc mem sort - save to flash or ftp etc

Started by Dieselboy, August 04, 2016, 01:59:45 AM

Previous topic - Next topic

Dieselboy

Does anyone have handy a cron job for IOS CLI to hand that they could share?

I keep getting memory leaks on one of my routers and each time I upgrade the code to mitigate it I find another new memory leak. Memory seems stable-ish, I was thinking of running a job that basically logs the "show proc mem sort" command into a file. So, if memory starts leaking off again, I can give this info to tac. Actually I could ask tac to fit me up with it but that's even more lazy than politely asking here if someone has it to hand :)

On my CUCME router I had done something similar, I'll check the router when I get home hopefully the commands are still in there because I've forgotten some. On my voice router, I had the router monitor itself. For some reason the POTS line used to send a signal to the router which left the router halfway between being idle and ringing. This meant Caller ID broke until the next call cleared this state. So the router monitored itself for what looked like an incoming call. If after 60 seconds (shortest time I could configure) the syslog did not log a "ringing", the router (I think) done a shut/no shut on the pots interface which cleared the state and meant that CLID on incomming pots call worked for every call after that :)

SimonV

what if you try the following command:

show processes cpu history | redirect tftp://URL

And use KRON to schedule it on a regular interval: http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/cns/configuration/15-s/cns-15-s-book/cns-cmd-sched.html

QuoteSUMMARY STEPS
1.    enable
2.    configure terminal
3.    kron policy-list list-name [conditional]
4.    cli command
5.    exit
6.    kron occurrence occurrence-name [user username] {in[[numdays:]numhours:]nummin| at hours:min[[month] day-of-month] [day-of-week]} {oneshot| recurring| system-startup}
7.    policy-list list-name
8.    exit
9.    show kron schedule

Curious to find out, I'm sure it will work with some fiddling around!

edit: sorry for the necropost  :whistle: that's how far behind I am with the forum

mmcgurty

Would you be able to do an EEM script for this and save it to flash?  I think I have done something similar in Nexus 7K but it has been a while.  If you want me to look, I can dig and see if I have notes.

Dieselboy

I've been meaning to come back to this but not had much free time.

I was thinking of running a kron which then runs a set of commands and appends the output to a text file on flash. SimonV I think you have  the steps :)