Cisco TCL/EEM HowTo

Some pointers for TCL/EEM setup.

(config)# event manager directory user policy "flash0:/"
        # show event manager directory user library
(config)# event manager policy monitorCO.tcl
        # show event manager policy registered 
(config)# no event manager policy monitorCO.tcl
        # show event manager history events
        # event manager run monitorCO.tcl
(config)# event manager environment monitorCO_INTERVAL 30
        # show event manager environment
  1. Start tclsh;
  2. Enter
    puts [open "flash0:/monitorCO.tcl" w+] {

    Do NOT hit the ENTER key at the end of the line.

  3. Copy-paste the file contents. The contents should not include unmatched curly right brackets (every curly right bracket has to be preceded by a matching curly left bracket).
  4. After the file contents have been pasted, enter }, and press ENTER.
  5. End the tclsh session with tclquit.

Check that your file was correctly inserted to flash:

# more monitorCO.tcl
!
kron occurrence minute in 1 recurring
 policy-list monitorCOrun
!
kron policy-list monitorCOrun
 cli event manager run monitorCO.tcl
!
  • cobgp/cisco_tcl_eem
  • Last modified: 2013-09-30T15:49
  • by kuski