Looking for something else?
Titan – AN36: Using Titan Router as SNMP Traps to SMS and MQTT Gateway
Table of Contents
Titan routers have all the funcionalities a 2G/3G/4G router has, plus a variety of additional features that make it into one of the most functional router in the marketplace.
One of those additional features is the ability to create an SNMP traps gateway to SMS and MQTT/MQTTS.
As usual, we will illustrate this functionality with an easy example.
Description of the Example
We have a SAI power supply generating several alarms (via SNMP traps), and there is a power failure or malfunction.
We need the router Titan to gather said traps and send SMS to the maintenance team when those traps are received. Also, we need those traps to be sent to a platform via MQTT to manage the history.
Configuration of the OIDs, SMS on the Titan Router
For this scene, we will use the plugin SnmpSMS in the index section “Plugins” > “SnmpSMS.” To enable it, we need to select the box “Enabled” and “Logger (so each captured trap is stored in the internal datalogger and sent to an mqtt broker)” in that same section. We also need to specify the traps OIDs that we want to capture. For example, if the trap “188.8.131.52.4.1.457184.108.40.206.1.1.1” shows a power failure and the trap “220.127.116.11.4.1.45718.104.22.168.1.1.2” shows malfunctioning, we should specify it as shown in the screenshot below:
In the fields OIDx we can specify the whole trap, or just a part of it. For example, if we specify just “22.214.171.124.4.1.45711”, any trap containing this text would activate the alarm. In the fields MessageX we specify the text of the SMS message (alphanumeric characters) the Titan router should send for each trap.
To specify the thelephone numbers to send the SMS to, we will specify up to 5 telephone numbers on the bottom of the previous screenshot.
Activating the Datalogger and the Sending via MQTT
Once the plugin is configured, we need to configure the datalogger section as well as the MQTT section. To do that we click on the menu “External Devices > Logger configuration” and enable the box “Enabled” on the MQTT section and fill in the topic we want the Titan router to send the storage information. In this example we Will write as the topic “logger.” The next screenshot shows this configuration:
After configuring the Titan router datalogger to send the stored data via MQTT, we need to configure the MQTT section, where we tell the Titan router which broker to use. To do that we click on the section “Other > Mqtt.”
This way, each time the Titan router collects a valid SNMP trap, it will be resent to the MQTT broker in JSON format. Said JSON will have the following structure:
Where TYPE specifies the kind of JSON sent, TS specifies the TIMESTAMP when the event took place, IMEI specifies the Titan router imei, and DATA includes the OID received by the router.