cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10610
Views
8
Helpful
3
Replies

Manually Run EEM Scripting Problems

JohnTylerPearce
Level 7
Level 7

Greetings,

 I'm trying to configure an EEM script with an 'event of none', so that I can manually run the EEM script. I basically have the following script configured on a router.

event manager applet TSHOOT

 event none

 action 1.0 cli command "sh run | I LINK"

 action 2.0 cli command "sh run | I LINE"

 action 3.0 cli command "sh log | I Controller"

 action 4.0 cli command "sh int x/x/x:0 | sec rate"

 action 5.0 cli command "sh controller t1 x/x/x | I [1-9]"

I can go to Privileged Exec mode and type "event manager run TSHOOT", it accepts the command but nothing happens. I put the "event none", since it's not really waiting on a trigger, and so I can manually run it. Am I doing something wrong? I don't see any output at all from these commands after I run "event manager run TSHOOT".

3 Replies 3

thiland
Level 3
Level 3

EEM doesn't automatically run as a privileged user.  Try adding:

action 0.5 cli command "enable"

Best to see exactly what it's doing though by running a debug (make sure you're logging buffer is set to debug level):

debug event manager action cli

Yes, enable is definitely needed, but EEM will also not print the results of the commands by default.  You need to add something like the following between each cli action:

action 1.5 puts $_cli_result

David Mena
Level 1
Level 1

Hello Team, I think the method proposed by  @thiland its very helpfully at least was tested by myself and results were good, below the example:

event manager applet TSHOOT2
event none
action 0.1 cli command "enable"
action 1.0 cli command "conf term"
action 2.0 cli command "int g0/1"
action 3.0 cli command "no shutdown"
action 4.0 cli command "end"

R1#event manager run TSHOOT2

R1#show log | inc TSHOOT2

Sep 4 00:55:35.539: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : CTL : cli_open called.

Sep 4 00:55:35.542: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : OUT : R1>
Sep 4 00:55:35.542: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : IN : R1>enable
Sep 4 00:55:35.552: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : OUT : R1#
Sep 4 00:55:35.552: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : IN : R1#conf term
Sep 4 00:55:35.562: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : OUT : Enter configuration commands, one per line. End with CNTL/Z.
Sep 4 00:55:35.563: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : OUT : R1(config)#
Sep 4 00:55:35.563: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : IN : R1(config)#int g0/1
Sep 4 00:55:35.573: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : OUT : R1(config-if)#
Sep 4 00:55:35.573: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : IN : R1(config-if)#no shutdown
Sep 4 00:55:35.718: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : OUT : R1(config-if)#
Sep 4 00:55:35.718: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : IN : R1(config-if)#end
Sep 4 00:55:35.721: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:TSHOOT2)
Sep 4 00:55:35.729: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : OUT : R1#
Sep 4 00:55:35.729: %HA_EM-6-LOG: TSHOOT2 : DEBUG(cli_lib) : : CTL : cli_close called.
Sep 4 01:13:52.008: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:TSHOOT2)

Review Cisco Networking for a $25 gift card