We use the event manager for starting a tcl script.
But the tcl script cannot run.
After a launch the record appeared in the log:
016038: .Apr 2 15:40:26.100 PCTime: %HA_EM-3-FMPD_CLI_CONNECT: Unable to establish CLI session: timeout error
If I start the script by hand, it works normally.
Cisco 1812, ios c181x-advipservicesk9-mz.124-15.T8.bin
The part of the config:
event manager applet MainLinkLost
event counter name "lost_count" entry-val 12 entry-op eq exit-val 12 exit-op eq
action 1.0 syslog msg "ALARM link to 91.x.x.x is down. Going to backup channel"
action 2.0 cli command "tclsh test.tcl"
The script contains only one string -
puts "TEST MESSAGE"
I suspect a problem with IOS, because on an earlier IOS it worked.
What can be wrong?
No, Safe Tcl does not support exec. However, if you look at the same policy I wrote for you, I included my run_cli proc. You can use this proc to easily run CLI commands. For example:
run_cli [list "clear ip nat translation forced" "clear crypto isakmp" "clear crypto session"]
You also have "enable" twice in this applet.
First, you should not be chaining EEM and tclsh together. Instead, convert your tclsh script to an EEM Tcl policy. For example, the attached policy will do what you're doing now.
Second, tclsh requires enable level 15 access. Therefore, you will need something like the following in your applet:
action 1.5 cli command "enable"