EEM script using up all VTY lines. Why?

Unanswered Question
Jan 2nd, 2009
User Badges:

In one of my router's logs, I saw:

000910: Dec 31 23:59:00.405 MST: %HA_EM-3-FMPD_CLI_CONNECT: Unable to establish CLI session: no tty lines available, minimum of 2 required by EEM

so I logged into it (an 1811W running IOS 12.4(11)XW5) yesterday and when I did a "show user" I saw this:

SAFRTR#show user

Line User Host(s) Idle Location

6 vty 0 idle 2w5d EEM:testemailapplet

7 vty 1 idle 2w4d EEM:testemailapplet

8 vty 2 idle 2w3d EEM:testemailapplet

9 vty 3 idle 2w2d EEM:testemailapplet

10 vty 4 idle 2w1d EEM:testemailapplet

11 vty 5 idle 2w0d EEM:testemailapplet

12 vty 6 idle 1w6d EEM:testemailapplet

13 vty 7 idle 1w5d EEM:testemailapplet

14 vty 8 idle 1w4d EEM:testemailapplet

15 vty 9 idle 1w3d EEM:testemailapplet

16 vty 10 idle 1w2d EEM:testemailapplet

17 vty 11 idle 1w1d EEM:testemailapplet

18 vty 12 idle 1w0d EEM:testemailapplet

19 vty 13 idle 6d08h EEM:testemailapplet

* 20 vty 14 gtisupport idle 00:00:00

So it looks like my EEM applet is not exiting after it runs and freeing up the VTY... I don't understand why... it works just fine: every night at midnight it sends me an email with the output of CLI commands "show ip accounting" and "show interface FastEthernet0" and then clears the stats... here is the script:

event manager environment _mail_domain

event manager environment _mail_smtp emailserver

event manager environment _mail_rcpt [email protected]

event manager applet testemailapplet

event timer cron name "_EEMinternalname0" cron-entry "59 23 * * *" maxrun 9999999

action 1.0 info type routername

action 1.5 cli command "enable"

action 2.0 cli command "show ip accounting"

action 3.0 mail server "$_mail_smtp" to "$_mail_rcpt" from "$_info_routername@$_mail_domain" subject "show ip accounting" body "$_cli_result"

action 4.0 cli command "clear ip accounting"

action 5.0 cli command "show interface FastEthernet0"

action 6.0 mail server "$_mail_smtp" to "$_mail_rcpt" from "$_info_routername@$_mail_domain" subject "show int FE0" body "$_cli_result"

action 7.0 cli command "clear counter FastEthernet0"

action 8.0 cli command "exit"



Any thoughts?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Collin Clark Fri, 01/02/2009 - 08:24
User Badges:
  • Purple, 4500 points or more

Try entering these two commands in your router config, they will terminate "disconnected" sessions.

service tcp-keepalives-in

service tcp-keepalives-out

Hope that helps.

Joe Clarke Fri, 01/02/2009 - 09:51
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

It's action 7.0 that's causing the problem. This command is interactive, and causing your policy to stall. Try doing this:

action 7.0 cli command "clear counter FastEthernet0/0" pattern "confirm]"

action 7.1 cli command "y"

That should fix you up.


This Discussion