EEM ON ISR router

Unanswered Question
Feb 11th, 2010
User Badges:

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.


Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Joe Clarke Sat, 02/13/2010 - 21:22
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

What version of IOS is running on this router?

Joe Clarke Sun, 02/14/2010 - 10:18
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

I figured that, but EXACTLY what version of 12.4?  Newer versions of 12.4T will mean a different EEM solution can be used.

Joe Clarke Sun, 02/14/2010 - 10:32
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

EXACTLY what version?  Please post the "show version" output from this router.

ahmedbekhit Sun, 02/14/2010 - 10:45
User Badges:

HI again Joe,


Here you are the output of show version:


Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9_IVS-M), Version 12.4(11)T2, RELEASE SOFTWARE (fc4)

Thanks!

Joe Clarke Sun, 02/14/2010 - 11:19
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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 protected]

event manager environment _email_to [email protected]

event manager environment _email_cc [email protected]


That configuration will run the policy every two hours, and send the top 10 lines of "show proc mem sorted" and "show proc cpu sorted" via email to [email protected] and [email protected].

ahmedbekhit Sun, 02/14/2010 - 11:32
User Badges:

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?

Joe Clarke Sun, 02/14/2010 - 11:37
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

No, not with your version of code.  You could do what you want without Tcl in 12.4(22)T or higher.

ahmedbekhit Mon, 02/15/2010 - 03:08
User Badges:

Thanks Alot Joe for the value info.


Can you tell me what is the compatible versions of 12.4 and what are the direct commands?


Thanks!

Joe Clarke Mon, 02/15/2010 - 15:37
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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,

Leo Laohoo Sun, 02/14/2010 - 13:12
User Badges:
  • Super Gold, 25000 points or more
  • Hall of Fame,

    The Hall of Fame designation is a lifetime achievement award based on significant overall achievements in the community. 

  • Cisco Designated VIP,

    2017 LAN, Wireless

Nice one Joe (+5)!

Actions

This Discussion