If you think of a Nagios/Icinga alert for example: Just use NetSMS on a cheap Android Device to send you SMS Messages. No need for a GSM Modem anymore.
You can use NetSMS manually or via a Script. The Syntax is really simple.
To get started:
1. Open NetSMS and grant SMS permission
2. Chose a TCP Port to Listen on or use the default one
3. Tap on the Button to enable NetSMS
4. Connect to NetSMS using the IP Address and TCP Port that is displayed
For example: "0049170123456789:Hi, I'm using a brand new Tool: NetSMS. Just try yourself."
On Linux for example, a simple
echo '0049170123456789:This is a Test Message' | nc IP Port
will do the trick.