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

New to the EEM, need some assistance

TexasBrandon
Level 1
Level 1

Well, I have been getting weird call loops on one of my CUBE's and instead of me being up until 2am waiting for the occurence to happen I would rather have a script run since it is like clockwork.  My coworker told me about EEM and I have been dabbling with it and getting no success.  I am on version 3.0 based on the "show event manager version" command and here is what I have so far.  I'm sure most if not all of this is wrong, can anyone point me in the right direction?

2    applet    user    syslog              Off   Wed Oct 10 18:33:26 2012  none  loopedcalls

pattern {%CALL_CONTROL-6-CALL_LOOP: The incoming call has a global identifier already present in the list of currently handled calls. It is being refused.}

maxrun 20.000

action 1.0 cli command "show log"

action 2.0 cli command "show call history voice last 10"

action 3.0 cli command "clear log"

action 4.0 wait 90

action 5.0 cli command "show call history voice 100"

action 6.0 mail server "192.168.1.1" to "john.doe@email.com" from "loopalaerts@email.com" subject "AUDC1M1APVGR01 Call Loops" body "$_cli_result"

Basically everytime a looped call happens it produces an alert labled %CALL_CONTROL-6..... and I want to capture that log and produce a show call history voice last 10 command along with everything else and ship it off as an email.  I also wanted to write the entire deal to flash but I can't find any way to actually do that.  Can anyone give me some insight as to what I am doing wrong? 

Thanks,

Brandon

1 Accepted Solution

Accepted Solutions

Yes, the command would become:

action 5.0 cli command "show call gistory voice 100 | tee flash:call_history.txt"

This is exactly how it would work from the CLI if run manually.

For the wait, you can configure an additional applet from within your main applet:

action 4.0 cli command "config t"

action 4.1 cli command "event manager applet call-wait"

action 4.2 cli command "event timer countdown time 90"

action 4.3 cli command "action 1.0 cli command enable"

action 4.4 cli command "action 2.0 cli command $q show call history voice 100 | tee flash:call_history.txt$q"

action 4.5 cli command "action 3.0 mail server 192.168.1.1 to john.doe@email.com from "loopalaerts@email.com" subject $q AUDC1M1APVGR01 Call Loops$q body $_cli_result"

action 4.6 cli command "action 4.0 cli command $q config t$q"

action 4.7 cli command "action 5.0 $q no event manager applet call-wait$q"

action 4.8 cli command "end"

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

Two issues here.  One, you need to add:

action 0.5 cli command "enable"

Second, you cannot sleep for 90 seconds within an EEM policy.  By default they are only allowed to run for 20 seconds.  Action 2.0 has no effect, so you might as well drop that one.  You can redirect the output to flash by adding a "| tee flash:call_history.txt" to the end of your show command.

Do you need to do this 90 second delay?

Yes, the call loops that happen don't happen constantly but sporadically within a couple of minutes.  I want to ensure that I am getting a few of the show call history commands to make sure that I get all of the loops since we have many calls going through our CUBES at the same time.  Thanks for the response.  Also, I am, guessing the "| tee...." command is put within the " " marks since it is part of that action? 

Yes, the command would become:

action 5.0 cli command "show call gistory voice 100 | tee flash:call_history.txt"

This is exactly how it would work from the CLI if run manually.

For the wait, you can configure an additional applet from within your main applet:

action 4.0 cli command "config t"

action 4.1 cli command "event manager applet call-wait"

action 4.2 cli command "event timer countdown time 90"

action 4.3 cli command "action 1.0 cli command enable"

action 4.4 cli command "action 2.0 cli command $q show call history voice 100 | tee flash:call_history.txt$q"

action 4.5 cli command "action 3.0 mail server 192.168.1.1 to john.doe@email.com from "loopalaerts@email.com" subject $q AUDC1M1APVGR01 Call Loops$q body $_cli_result"

action 4.6 cli command "action 4.0 cli command $q config t$q"

action 4.7 cli command "action 5.0 $q no event manager applet call-wait$q"

action 4.8 cli command "end"