I want to configure the ISR router to Send the top 10 CPU and Memory Utilization every two hours to my email addess, I went through too many documents and I found a lot of solutions which are confusing me some of them using cron job, some of them Using OID and others using TCL Scripts.
Please assist me in the easiest way.
This EEM Tcl policy should do what you want. Before installing it, you will need to set some environment variables, though:
# mem_cpu_time : Number of seconds between executions of this policy.
# mem_cpu_num_lines : Number of lines to include in the output.
# _email_server : SMTP server used to send email.
# _email_from : Email address from which email will be sent.
# _email_to : Email address(es) to which email will be sent.
# _email_cc : (optional) Email address(es) to which email will be
# carbon copied.
For example, in "config t" mode:
event manager environment mem_cpu_time 7200
event manager environment mem_cpu_num_lines 10
event manager environment _email_server 10.1.1.1
event manager environment _email_from email@example.com
event manager environment _email_to firstname.lastname@example.org
event manager environment _email_cc email@example.com
Thanks Joe for the script, I will try it and get back to you; However; is there any direct commands that we can made without installing the TCL scripting?
This policy will work on any device running 12.3(14)T or higher. You must first copy the policy to the device (e.g. to flash:/policies on your ISR router). Then, configure the router with the appropriate EEM user policy directory:
event manager directory user policy flash:/policies
Then, register the policy with the EEM server (again, from "config t" mode):
event manager policy tm_check_mem_cpu.tcl
Once those two commands are configured (and, of course, the policy has been copied to the device and you have set the environment variables I mentioned previously), the policy will be running,