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

EEM Script to reset modem and check result to re-run or exit

ddrysdale69
Level 1
Level 1

I'm looking to adjust a script we use to reset the Cellular modems if a Track instance does down.

The adjustments are to check the status of a Track and based on the result, loop back to reset the modem again, or proceed and exit the script.

I'm having issues with the use of the regexp which I understand should work for this purpose. Can any-one advise. Below is the script now as edited :

event manager applet reset_3g
 event track 12 state down maxrun 1200
 action 001     syslog priority informational msg "Power cycling modem"
 action 002     cli command "enable"
 action 003     cli command "config terminal"
 action 004     cli command "service internal"
 action 005     cli command "end"
 action 006     cli command "test cellular 0/0/0 modem-power-cycle"
 action 007     wait 340
 action 008     cli command "show track 10"
 action 009     regexp "Latest operation return code:" "$_cli_result"
 action 010     if $_regexp_result eq "Timeout" goto 6
 action 011else regexp "$_regexp_result" "eq" OK
 action 012     if $_regexp_result eq "Up" goto 13
 action 013     cli command "config terminal"
 action 014     cli command "no service internal"
 action 015     cli command "end"

Track 12 monitors Track 10 & 11. If both go down, based on IP SLA stats, this Track 12 goes down. causing the script to Trigger. Action 8 in the script is to check the Track 10 for it's Operation Return Code

Thanks

2 Replies 2

ddrysdale69
Level 1
Level 1

Pasted in the incorrect version of the script. Below is the active one:

event manager applet reset_3g

 event track 12 state down maxrun 1200

action 001     syslog priority informational msg "Power cycling modem"

 action 002     cli command "enable"

 action 003     cli command "config terminal"

 action 004     cli command "service internal"

 action 005     cli command "end"

 action 006     cli command "test cellular 0/0/0 modem-power-cycle"

 action 007     wait 340

 action 008     cli command "show track 10"

 action 009     regexp "Latest operation return code:" "$_cli_result"

 action 010     if $_cli_result eq "Timeout" goto 6

 action 011else regexp "$_cli_result" "eq" OK

 action 012     if $_cli_result eq "OK" goto 13

 action 013     cli command "config terminal"

 action 014     cli command "no service internal"

 action 015     cli command "end"

Hi

I'm looking to achieve the same.  Did you leave the script the same as your example or has it been improved in any way?

Thanks

Rick

Review Cisco Networking for a $25 gift card