Sample

EEM is a powerful tool which can use an email action to send a status report. In this example a route reload is detected, and an email is sent informing of the reload. A sample configuration is:

> en
# config t
(config)# event manager applet RELOAD
(config-applet)# event timer countdown name delay time 10
(config-applet)# action 1.0 info type routername
(config-applet)# action 1.1 mail server smtp.my.com to me@home from me@home subject reload
(config-applet)# action 1.2 syslog msg sent

Sample

> en
# config t
(config)# event manager applet RELOAD
(config-applet)# event ?
  application  Application specific event
  cli          CLI event
  counter      Counter event
  interface    Interface event
  ioswdsysmon  IOS WDSysMon event
  none         Manually run policy event
  oir          OIR event
  snmp         SNMP event
  syslog       Syslog event
  timer        Timer event
(config-applet)# event timer ?
  absolute   Absolute timer event
  countdown  Countdown timer event
  cron       Cron timer event
  watchdog   Watchdog timer event
(config-applet)# event timer countdown ?
  name  Name of the timer
  time  Time period for watchdog / countdown / absolute timer
(config-applet)# event timer countdown name ?
  WORD  Timer name string
(config-applet)# ev t co n delay ?
  time  Time period for watchdog / countdown / absolute timer

(config-applet)# ev t co n delay time ?
  <0-4294967295>  Enter seconds[.milliseconds] value
(config-applet)# event timer countdown name delay time 10
(config-applet)# action ?
  WORD  Label
(config-applet)# action 1.0 ?
  cli               Execute a CLI command
  cns-event         Send a CNS event
  counter           Modify a counter value
  force-switchover  Force a software switcho
  info              Obtain system specific i
  mail              Send an e-mail
  policy            Run a pre-registered pol
  publish-event     Publish an application s
  reload            Reload system
  snmp-trap         Send an SNMP trap
  syslog            Log a syslog message
(config-applet)# action 1.0 info ?
  type  Type of information to obtain

(config-applet)# action 1.0 info type ?
  cli         CLI information
  routername  Router name
  snmp        SNMP information
  syslog      Syslog information
(config-applet)# action 1.0 info type routername
(config-applet)# action 1.0 mail ?
  body     Body text
  cc       CC address
  from     From address
  server   Mail server address
  subject  Subject line text
  to       To address
 
(config-applet)# action 1.0 mail server ?
  WORD  address

(config-applet)# action 1.0 mail ser smtp.my.com ?
  body     Body text
  cc       CC address
  from     From address
  subject  Subject line text
  to       To address
(config-applet)# action 1.0 mail ser smtp.my.com to ?
  WORD  address
 
(config-applet)# action 1.0 mail ser smtp.my.com to me@home?
  body     Body text
  cc       CC address
  from     From address
  subject  Subject line text

(config-applet)# action 1.0 mail ser smtp.my.com to me@home from ?
  WORD  address
 
(config-applet)# action 1.0 mail ser smtp.my.com to me@home from me@home ?
  body     Body text
  cc       CC address
  subject  Subject line text
(config-applet)# ac 1.0 mail ser smtp.my.com to me@home from me@home subject ?
  WORD  subject text
(config-applet)# action 1.1 mail server smtp.my.com to me@home from me@home subject Reload
(config-applet)# action 1.2 syslog msg E-mail sent...

The result of the log will be in the form:

00:00:10: %SYS-5-CONFIG_I: Configured from memory by console 00:00:11: %SYS-5-RESTART: System restarted -- 00:00:11: %SNMP-5-COLDSTART: SNMP agent on host c7200 is undergoing a cold start 00:00:20: %HA_EM-6-LOG: sent...

Where a delay of 10 seconds occurs before the email is sent.