Professional Documents
Culture Documents
about:reader?url=https://karp.id.au/a/2014/12/...
karp.id.au
I have a couple of point-to-point WiFi links. One of these uses a 5 GHz NanoBridge, the other a 900
MHz Loco M900. The web interface on these has all kinds of interesting statistics that I would like
to get into my Zabbix server for logging and graphing.
The good news is that these devices support SNMP and also at least part of Mikrotiks
experimental SNMP module. This means if you do a walk over enterprises.14988 you get 7 OIDs
containing interesting information about each connected client. Remember to turn on the SNMP
service on the Ubiquiti router first.
$ snmpwalk -v 1 -c
public
SNMPv2-SMI::enterprises.14988.1.1.1.2.1.6.36.164.60.52.42.149.5 = Counter32: 3
1 de 7
14-11-2016 14:52
about:reader?url=https://karp.id.au/a/2014/12/...
.4 transmitted bytes
.5 received bytes
.6 ?
.7 received packets
Following that we have the MAC address of the connected client. This client has the address
24:A4:3C:34:2A:95. 36 is 24 in decimal, and so on. This seems like a pretty clever way to avoid
OIDs clashing as clients connect and disconnect.
The bad news is that Zabbix low-level SNMP discovery does not appear to cope with this situation
very well. You and I can easily see that each one of those MAC address blocks represents a client.
The example in the Zabbix documentation suggests that we need some OID that provides a
mapping of index numbers to names. This is pretty good for switches and the like. We dont have
one here so I dont think we can use discovery. (Perhaps Im wrong but Ive hit a dead end for now.
See note at the bottom about alternatives.)
All is not lost, though. If we know which client(s) are going to be connected to a particular AP we
can use macros to specify the particular MAC address. That is, for each Zabbix Host (Ubiquiti
router) we will add a macro {$MAC_OID} containing a partial OID like 36.164.60.52.42.149 . We
can create a NanoBridge template that uses this macro and assumes it will be present for any Host
it is linked to.
2 de 7
14-11-2016 14:52
about:reader?url=https://karp.id.au/a/2014/12/...
We have five of the fields described above and two calculated fields to show how much data was
transmitted and received per second. I also pulled out two general pieces of information so I dont
get confused:
This is what the client-specific Items look like with the macro inserted inside the OID.
This is what the calculated Items look like. I have an update interval of 30 seconds so I divide the
3 de 7
14-11-2016 14:52
about:reader?url=https://karp.id.au/a/2014/12/...
byte counter by 30. I then multiply by 8 to get a value in bits per second. This is useful because you
can plot it on the same graph as reported TX and RX capacity. (This graph is included in the XML
template linked above.)
To prepare your Host for the template you just need to add a macro like this:
4 de 7
14-11-2016 14:52
about:reader?url=https://karp.id.au/a/2014/12/...
It would be lovely to use Zabbix discovery and this is not out of the question. If you SSH to your
Ubiquiti AP (who knew) the command wstalist spits out a neat JSON array with detailed
information about all connected clients. It would be an interesting little project to make a
translation layer that enables Zabbix to query that dataor perhaps insert data in the other
direction so that the poor Ubiquiti isnt being hammered by SSH connections.
$ ssh 192.168.2.101
-l ubnt wstalist
5 de 7
"mac": "24:A4:3C:34:2A:95",
"lastip" : "10.130.1.130",
"associd" : 1,
"aprepeater" : 0,
"tx" : 52,
10
"rx" : 26,
11
"signal" : -82,
12
"ccq" : 98,
13
"idle" : 5,
14-11-2016 14:52
14
"uptime" : 172892,
15
"ack" : 38,
16
"distance" : 2400,
17
"txpower" : 22,
18
"noisefloor" : -93,
19
"airmax" : {
20
"priority" : 0,
21
"quality" : 0,
22
"beam" : -1,
23
"signal" : 0,
24
"capacity" : 0 },
25
6 de 7
about:reader?url=https://karp.id.au/a/2014/12/...
"stats" : {
26
"rx_data" : 995636,
27
"rx_bytes" : 1448816552,
28
"rx_pps" : 0,
29
"tx_data" : 605474,
30
"tx_bytes" : 40700451,
31
"tx_pps" : 0 },
14-11-2016 14:52
32
33
34
35
7 de 7
about:reader?url=https://karp.id.au/a/2014/12/...
14-11-2016 14:52