Twitter

by acls us

Using Hologram/Nova to pass data to Zabbix via Node Red

 

Zabbix

Node RedHologram

Nova

   

On a past IoT project (see here) I had used a Pi Zero to collect data via it's gpio interface from an Analogue to Digital Converter (ADC) connected to a temperature sensor chip. The actual collection being performed by a Zabbix Agent on the Pi Zero and passed back to Zabbix over a WiFi/Internet connection. While this works fine, it is limited the a location that has WiFi. To be able to use this in a more "Mobile" manner a Cellular Data connection method is required. To start with I have used Hologram for the Cellular Network and their Nova GSM 2G/3G Modem to connect with.

 

 

 

I'm just going to give an overview of how this all works and the issues, then go into detail on another occasion. I'm not going to cover the physical ADC and sensor setup as it's the same as in previous projects.

Hologram act as the Data Network Provider in that the SIM they provide can be used to connect to their Cellular connection APN (the gateway between their Cloud and the GSM Network). The Nova USB GSM Modem, gives the connected Pi Zero serial port access to the GSM chip (U-BLOX U201) in the Nova to process standard "AT" commands. Hologram provide an SDK, written in Python, that can be simply installed on the Pi Zero to take away all the complexity of managing "AT" command processing. The Hologram SDK provides a Command Line Interface (CLI) that allows simple text messages to be sent via a data connection to the Hologram Cloud, a full blown IP PPP connection can also be instantiated that allows Internet Access and inbound tunnelling access to the PI Zero. There are also commands to query and control the connections. Data usage and status can be monitored and controlled from the Hologram Cloud. The routing of messages can also be controlled via the Hologram Cloud. I have used this to route the simple text messages from the Pi SDK CLI to an end point that has a Node Red flow listening on it. This allows me to get the data from the text messages and push them into Zabbix via a Zabbix Sender.

I have tested the Cellular Network data usage of sending simple text messages (500 Bytes plus the message) vs. a Zabbix Agent connection over a full blown IP connection (14.5 KBytes). Giving the obvious conclusion that the text message approach should be used. Optimisation of traffic is a BIG thing with Cellular Network data plans. Hologram will provide a "Pilot" SIM for free with one MByte included. Subsequent data traffic is $0.40USD/MByte.

A separate niggle is the cost of getting a NOVA USB GSM Modem as they are only available from the States with pricy shipping and import duties. I will be looking at other devices available in the UK.

 

Monitoring UBNT UniFi WiFi with Zabbix and Node Red

UBNT

Zabbix

Node Red

   

Having implemented Zabbix monitoring for Tanaza managed WiFi devices (here), the next step was to monitor Ubiquiti UniFi APs that were managed via a UniFi Controller. Ubiquiti have been more and more of a closed system over the last couple of years as they introduce more ways to lock in their customers by introducing management systems and hardware that prevent their hardware being used by more Open Systems. A particular example is the UniFi AP v2 which has been locked down to prevent the installation of third party Firmware, although they are very coy about this. So OpenWRT with a Zabbix Agent cannot be installed. This means that the only Zabbix monitoring available is to PING the devices.

 

The approach taken to getting UniFi Controller Managed WiFi APs into the same Zabbix monitoring environment as other network devices was to make use of the UniFi Controller API. This API is not at all well documented and may disappear if Ubiquiti decide the lock down their systems even further. The API exposed a number of end points that return JSON encoded data. These are used by a timer driven Node Red flow that queries the UniFi Controller every 120 seconds via a Logon, a query for the sites names and queries for all the devices/clients per site. The flow then totals up the number of connected clients per UniFi AP and passes the device's status, site name and connected clients to Zabbix via the Zabbix Sender.

PS - There is a Node Red Node available for communicating directly with the UniFi Controller API "node-red-contrib-unifi" but I have not personally tried this out yet.

 

 

 

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 Ubiquiti 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 encoded 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.