I had an issue where EEM complained about couldn’t execute due to no available TTY lines.
001214: Aug 6 03:29:21.488 UTC: %HA_EM-3-FMPD_CLI_CONNECT: Unable to establish CLI session: 'Embedded Event Manager' detected the 'fatal' condition 'no tty lines available, minimum of 2 required by EEM' 001215: Aug 6 03:29:21.488 UTC: %HA_EM-3-FMPD_ERROR: Error executing applet PRIMARY-DOWN statement 1.0
It turned out that there were users still connected to the router even though they were not doing anything. Use show users to determine the logged on users. This is common in an environment where engineers forgot to log out the terminal session or probably lost its connection to the router.
To reduce the risk of not getting this issue to re-occur I recommend following this guidelines:
1. Always exit the EEM session. Sample code below.
event manager applet PRIMARY-DOWN event track 20 state down action 1.0 cli command "enable" action 1.1 cli command "config t" action 1.2 cli command "router ospf 2" action 1.3 cli command "redistribute ospf 1 subnets match internal route-map RM-OSPF-FILTER-PROC1-TO-2" action 1.4 cli command "end" action 1.5 cli command "exit"
2. Configure an exec-timeout on VTYs. By default it is set to 10 minutes thus, the lower the timeout value the better.
3. Limit the number of EEM policies that can be executed simultaneously. Use the event manager scheduler TYPE thread class default number NUM, where TYPE is the policy type (either applet, shell, or script) and NUM is the number of policies that can be run simultaneously.