07-12-2017 07:39 PM
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
07-12-2017 08:15 PM
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"
02-20-2019 05:29 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide