Hello There, Guest! Login Register
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

SMS Server Tools 3 via cellular (USB)-dongle

When I installed my Nemslinux on the Raspi3, I had one main goal as a target: Monitoring my internet-connection, and sending SMS if it breaks down, obviously as it's the only communication back left in my home.
I thought about a separate UMTS/LTE-connection that the usb-dongle could also provide, but that would need a corresponding hosted monitoring service plus UMTS data - that surely will cost extra money, that I was not willing to pay.

The SMS-Server-Tools 3 are easy to install on NEMSlinux, a bit more difficult was it to configure the smstools to communicate with the dongle and to fiddle with the ttyusb0-comport always changing its ID on reboot, causing loss of communication. That was done by mapping the device-id to a symlink.

You will have to give the nagios-user permissions to create files under /var/spool/sms inherited, I just chose 777 for easygoing..

Then you would add two misccommand in nconf:


/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$ \nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:$LONGDATETIME$\n" | /usr/local/bin/sendsms $CONTACTPAGER$ "** $NOTIFICATIONTYPE$ Host Alert:$HOSTNAME$ is $HOSTSTATE$ **"


/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$ \nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:$LONGDATETIME$\n" | /usr/local/bin/sendsms $CONTACTPAGER$ "** $NOTIFICATIONTYPE$ Service Alert:$SERVICEDESC$ on $HOSTNAME$ State: $SERVICESTATE$ **"

and then configuring your contact with the new notify-command and adding a phone-nr in the format +49170123465

That's it, I still have to find out, how  I check for a failed internet connection, I think about pinging three individual internet-ip-adresses, and when ALL three fail, trigger a "Internet-down-SMS". (if interconnecting switch not down, if router not down, if DSL-Modem not down, keeping a proper parenting dependency. Still have to properly implement that, but it's cool not to be dependant on a running internet line for that monitoring-notifications to work.

It would also be a good idea to put this into the standard NEMSlinux wouldn't it?
Agreed. I'd love to include support for this out of the box.

Can you share a link to a compatible dongle for me to have a look?

Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Oh, there a serveral sites discussing implementation of various hardware running with the smsservertools, their forum is a good source.
For my part I found out that Huaweii-dongles work well, that also counts thousand of their provider-branded models out there. 

There are also pure serial-based solutions you can buy, they have their own documented setup for the tools - but I don't like old serial stuff...

The dongle I use is a branded T-Mobile Huawei E3276.

You will need to configure this file with smstoolsservice:

# /etc/smsd.conf
# Description: Main configuration file for the smsd

devices = GSM1
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
incoming = /var/spool/sms/incoming
logfile = /var/log/smstools/smsd.log
infofile = /var/run/smstools/smsd.working
pidfile = /var/run/smstools/smsd.pid
outgoing = /var/spool/sms/outgoing
checked = /var/spool/sms/checked
failed = /var/spool/sms/failed
incoming = /var/spool/sms/incoming
sent = /var/spool/sms/sent
stats = /var/log/smstools/smsd_stats
loglevel = 7


device = /dev/tmobile_dongle
incoming = yes
outgoing = yes
memory_start = 1
sending_disabled = no

That "/dev/tmobile_dongle" is the symlink I've created, for making reboots possible without losing connection to the dongle (following the link in my OT)

It's a bit tricky to setup, and hard to automate for plugnplay, but having an SMS-gateway running on nagios is a great feature. You can also let incoming sms be parsed and execute scripts to powercycle the modem or router, possibilities are endless.

Forum Jump:

Users browsing this thread: 1 Guest(s)