EEM 3G modem - Reset script found on the internet

Cisco routers may not need to be rebooted much but the modems in their 3G WICs certainly do. As I mentioned in my opening post we have an number of industrial devices that accept reboot command via SMS (Cybertec series 2000, Maxon Smartmax). They are also able to monitor their 3G conennections and will restart themselves if they detect a problem. We can't do SMS reboots on a Cisco router but we can get them to restart their 3G modems using EEM scripts.

From a production router:

service internal

!

track 200 interface Cellular0/0/0 line-protocol

delay down 60 up 10

!

event manager applet RESET-3G

event track 200 state down

action 1.0 cli command "enable"

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

action 3.0 syslog msg "EEM SCRIPT - 3G modem power cycled"

Notes:

1. The "service internal" command is necessary to enable the "test cellular 0/0/0 modem-power-cycle" command.

2. The delays on the tracking are there because many of our sites have transient cellular outages that rectify themselves within about 25 seconds. Resetting the modem every time would just extend the outage.*

3. We could have the EEM script reset the cellular interface but sometimes the 3G modem locks up and a "shut" and "no shut" on the cellular interface does not fix it. Resetting the 3G modem does.

* most of our sites are on pipelines in the middle of nowhere and generally 3G reception is poor. If your sites are located in towns or cities you may may not have these transient outages and so you can reduce or eliminate the tracking delays. ...

Cisco/Gsm3G/EEMreset (last edited 2013-03-12 05:51:15 by PieterSmit)