cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1643
Views
5
Helpful
3
Replies

EEM script using up all VTY lines. Why?

thomasdzubin
Level 1
Level 1

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 xxx.x.xxx.x

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 xxxxxxxxxxxxx.org

event manager environment _mail_smtp emailserver

event manager environment _mail_rcpt gtisupport@xxxxxxxx.com

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"

!

end

Any thoughts?

3 Replies 3

Collin Clark
VIP Alumni
VIP Alumni

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
Cisco Employee
Cisco Employee

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.

Yes, that did the trick! Thanks!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: