You can of course use your SMS Gateway to send alarms from Icinga 2 via SMS.
For this purpose you first need the script sendsms.pl. Download it and save it in your Icinga server in the /usr/lib/nagios/plugins/ directory.
The script is composed of the following Perl modules:
In the next step commands must now be configured for the SMS configuration in Icinga. Corresponding contacts must also be created.
Example: Definition for SMS notifications in /etc/icinga2/conf.d/commands.conf
Example: Definition of Host-/Service Templates for SMS notifications in /etc/icings2/conf.d/templates.conf
Example: Host-/Service Templates for SMS notifications on a host in /etc/icinga2/conf.d/notifications.conf
Example: Definition of a user group for SMS notifications in /etc/icinga2/conf.d/groups.conf
Example: Adding a contact to the user group for SMS notifications /etc/icinga2/conf.d/users.conf
The script sendsms sends the alarm to the SMS Gateway. As standard this communication takes place without encryption.
You can alter this behaviour in line 43 by converting the request to HTTPS:
If the SSL certificate set up in the SMS Gateway is a self-signed certificate, this may lead to an error message in icinga.log: Can't connect to ... (certificate verify failed)
In this case, add the following code in line 35: