Setting up a Raspberry PI to send SMS notifications was my task within a two-weeks student internship at ePages.
Starting position: the external service provider AnySMS is integrated in the Icinga Monitoring.
The Icinga sends error messages to our standby phone via AnySMS.
To being able to carry out this service ourselves, we realised this via a Raspberry Pi.
First, AnySMS and the Raspberry Pi should run in parallel, so that if one fails the other could still send an SMS.
The Raspberry Pi should be able to send SMS via a web service and has to be integrated with the Icinga.
Preparing the Raspberry Pi
Write Raspbian image to SD card.
Connect SD card, power supply, monitor, keyboard and LAN cable to Raspberry Pi and perform basic configuration.
Expand SD card (Expand filesystem) to make use of all the available space.
Change password.
Adjust language options.
Set up SSH connection.
etc.
Installing the Gammu SMS Daemon
To send SMS via Raspberry Pi, an SMS gateway has to be installed.
Connect a UMTS stick with SIM card to the Raspberry Pi (maybe use a USB hub if there are not enough connections available) and install the Gammu SMS Daemon on the Raspberry Pi.
As an alternative to Gammu you may also use SMS Server Tools 3, Kannel or the like.
Check if Raspberry Pi recognises the UMTS stick:
Download and install the Gammu SMS Daemon:
Configure the file /etc/gammu-smsrdc. according to the example; only the password varies:
Restart Gammu:
Send a test SMS:
Installing PlaySMS
Sending an SMS should be controlled via a website.
We use PlaySMS for this.
Install PlaySMS and the belonging software (Apache, PHP, MySQL, cURL):
Attention: if you’re asked for a new root password, choose a very strong one:
When calling the Raspberry Pi’s IP address in the browser, “It Works” should appear:
Install PlaySMS:
Copy the file install.conf.dist to install.conf, then edit the files:
Amend the content in the config file.
We used DBPASS as password for the root.
Run the following command:
If everything looks fine, confirm with Y.
To start PlaySMS as soon as the Raspberry Pi is initialised, configure the following file:
Write the following line to the end of the file and save:
Now amend the following file:
Reload Apache:
Now you can again call the website http://your-ip.
This time, a login screen should appear.
By default the login data are set to:
username: admin
password: admin
To connect PlaySMS and Gammu, add the gateway Gammu to PlaySMS:
Now you’re able to send SMS via PlaySMS or via the command line.
Installing SSL certificate
Use an SSL certificate to encrypt internet data transfer.
Integrating Raspberry Pi with Icinga
As you are now able send SMS via a URL, the only step remaining is integrating the Raspberry Pi with Icinga.
For AnySMS there’s already an integration, so that you can store the Bash files with the same path.
To change something within Icinga, you can use Git Bash.
Git Bash manages the changes within Icinga.
About the authors
Katharina belongs to the epagesdevs content team.
Norman Franke keeps ePages’ shops running - day and night - and is not afraid of standby duty.
Our website uses cookies to improve your user experience. Some cookies are
required for the basic functionality of the website while other cookies help
us to improve our content and layout. You can agree to all cookies by selecting
"Accept all" or you can select "Accept required" to confirm only the required ones.
Further information can be found in our
Data protection declaration.