cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
273
Views
0
Helpful
2
Replies

improving EEM script to reset voice-ports in park state

br345678
Level 1
Level 1

I am looking to improve upon the EEM script I have written below to reset voice-ports that are in a parked state. As of now I have the following 2 applets written for each and every voice port on the router, 0/[0-3]/[0-3]:[0-23] .

I am not having much luck simplifying this down using nested loop statement and/or regex to loop through each voice port .

Would someone mind pointing me in the right direction. Thank you!

 

event manager applet PARK_MONITOR_0/0/0:0
description MONITOR HOOT PORT 0/0/0:0 FOR PARK STATUS
event timer watchdog time 300 maxrun 65
action 1.0 cli command "enable"
action 1.2 cli command "show voice call summ | include 0/0/0:0"
action 1.3 regexp "ONHOOK" "$_cli_result"
action 1.4 if $_regexp_result eq "1"
action 1.5 cli command "event manager run HOOT_RESET_0/0/0:0"
action 1.6 end
event manager applet HOOT_RESET_0/0/0:0
description AUTOMATED HOOT PORT 0/0/0:0 TOGGLE BITS FOR PARK_MONITOR_0/0/0:0
event none
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "voice-port 0/0/0:0"
action 1.3 cli command "define Rx-bits seize 0000"
action 1.4 cli command "define Rx-bits seize 1111"
action 1.5 cli command "exit"
action 1.6 syslog priority notifications msg "HOOT 0/0/0:0 has been reset by EEM" facility "EEM-FAC"

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

check below thread definish port range and checking each port and do the reset :

https://community.cisco.com/t5/network-management/eem-script-to-monitor-and-shut-no-shut-fxo-port/td-p/2057283

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

The first EEM use watchdog the second one the even is none meaning it need to run  manually 

MHM

Review Cisco Networking for a $25 gift card