I guess a custom plugin would be an option, as already suggested. It is basically Python code, so you can adapt it to your specific needs.
Alternatively, you could use an alerting solution like SIGNL4, which supports SMS in addition to push notifications, voice calls, escalations, and more. It also supports heartbeat monitoring and website checks to detect a missing internet connection.