Twitter

by acls us

Monitoring Tanaza WiFi with Zabbix and Node Red

Tanaza

 

Zabbix

 

Node Red

   

Tanaza is one of a number of Managed WiFi Systems available today. If you exclude the TP-Link and Ubiquity type approaches to WiFi Management, which are tightly bound to their own hardware, almost without exception the cross platform WiFi Management Systems are based on customised builds of OpenWRT. This provides a WiFi Management System that allows a wide range of hardware from a wide range of manufacturers to be managed by the same system. This is a good thing. The only bad thing is that you cannot directly monitor what's going on inside the Managed Access Points via a Zabbix Agent as you can normally with OpenWRT.

 

The approach taken to getting Tanaza Managed WiFi APs into the same Zabbix monitoring environment as other network devices was to make use of the Tanaza API. This allows access to a snapshot of the current status of your Tanaza Managed Networks. The Tanaza API Status query end point returns JSON encodes data with the status of every Managed WiFi AP connected to your Tanaza account. This is used by a timer driven Node Red flow that queries Tanaza every 120 seconds and converts the JSON data into a JavaScript object representation, as this is more convenient to work with. The flow then does a sense check that the Tanaza query worked ok, HTTP status 200 set and the Tanaza's errorCode is zero. A Node Red Function is then used to step through the Tanaza data extracting the status information for each AP in turn. Then another Node Red Function is used to take certain data from the AP status and build zabbix_sender parameters for each host item that is to be sent to Zabbix. Finally the zabbix_sender is invoked to send the data to the Zabbix Server. The data being monitored for each AP is its online/offline status, the number of connected WiFi clients (totaled across all SSIDs on the AP) and the name of the Tanaza Network the AP is used in.

 

 

 

PowerTXT alerts via Twilio and Node Red into Zabbix (Part 2)

Zabbix

Node RedTwilio

PowerTXT

   

The project (see here) has moved on from a proof of concept to live now. The original Node.Red flow has been updated to delete the original Twilio message after having passed it on to Zabbix. A new flow has been added to accept requests from Zabbix to send PowerTXT commands via Twilio and a small flow has been created to allow Zabbix to check that Node.Red is up and running ok.

 

 

 

The original inbound SMS Node.Red flow now has the extra steps (at the bottom) which check if the message was sent to Zabbix ok and if so builds the command to send via the Twilio API to delete the original message from Twilio.

Node.Red

A new Node.Red flow has been added to accept requests from Zabbix and then send PowerTXT commands. In Zabbix, the requests are created by a Zabbix script that uses wget to send the request, which includes the Zabbix hostname (in the for sms_44nnnnnnnnn where nnnnnnnnn is the mobile number without the leading zero) and a command to perform (register, on, off or query). The flow verifies the request has originated from localhost and checks that the hostname and command parameters have been supplied. The symbolic command names are then translated into PowerTXT commands (e.g. #07# for query) and passed into a step that builds the request for Twilio. The request is sent and the reply from Twilio examined to see if the message was sent or not, the result of this test is used to pass a status back to the Zabbix script that originally requested the message be sent.

Node.Red

Finally a short Node.Red flow was added to that Zabbix can send a web request that is replied to with "OK" so Zabbix can check that Node.Red is running ok. This flow also checked that request originated from localhost.

Node.Red

PowerTXT alerts via Twilio and Node Red into Zabbix

Zabbix

Node RedTwilio

PowerTXT

   

A proof of concept for a client operating 56-60 Networks around the UK. Each Network has its own ADSL/FTTC/Cable/Fibre Backhaul Internet connection and Network Manager Server. The power to the Backhaul equipment is Monitored and Controlled via a TekView PowerTXT device which sends SMS messages for Power/Temperature events and accepts command via SMS to control the power and configure the device. Their overall Network is Monitored via Zabbix which needed to be aware of Power Outage events.

 

The approach used was to set the PowerTXT device to send it's status Text messages via the Mobile Network to a Mobile Number create on Twilio. The Twilio Mobile Number being configured to send the SMS wrapped in an http request to Node Red. A Node Red Flow takes the http request and extracts the "From" Mobile number and the Text data from the message, constructs a "zabbix_sender" command to use to pass the message to Zabbix which is stored aa "Zabbix trapper" data. The Node Red Flow also creates the response to the original https request from Twilio so it knows the request has been processed and there is no reply SMS to send. These also a bit of Debug logging to catch whats going on.

 Node Red Flow

The next stage will be to add to the Node Red Flow so that it will delete the original SMS from Twilio after its been processed and for it to parse the body of the SMS from the PowerTXT to detect Power OFF and ON event to pass to Zabbix.

(Part 2 is here)