iTranslated by AI
[Zabbix 7.0] Simple Implementation of Low-Level Discovery (LLD)
You know those [Discovery] items in ZABBIX templates?
They're really convenient. Once you create one, you can, for example, collect the same information (like traffic volume) for as many interfaces as exist.
I was planning to incorporate them into my own custom templates, but I was struggling because the official documentation was a bit hard to understand (though it might just be my skill level).
Anyway, after messing around while referencing the official templates, I managed to create it surprisingly easily, so I'll leave this here as a memo.
Step 1: Decide on the information you want to acquire
I decided on the following information to acquire via discovery:
- Number of clients per SSID for a wireless AP
The target device is a Cisco wireless AP, so this time we'll be using SNMP.
Next, collect the information necessary for creating the discovery. We need the following two items:
1. OID to acquire the SSID name
2. OID to acquire the number of clients per SSID
These can be obtained using the snmpwalk command, so I actually retrieved the values from the ZABBIX server.
### Example of Cisco AIRESPACE-WIRELESS-MIB ###
# OID to acquire the SSID name
[unchiman@zabbix111 ~]$ snmpwalk -v 2c -c $COMMUNITYNAME -On 192.168.XX.XX bsnDot11EssSsid
.1.3.6.1.4.1.14179.2.1.1.1.2.1 = STRING: MainSSID
.1.3.6.1.4.1.14179.2.1.1.1.2.2 = STRING: SubSSID
# OID to acquire the number of clients per SSID
[unchiman@zabbix111 ~]$ snmpwalk -v 2c -c $COMMUNITYNAME -On 192.168.XX.XX bsnDot11EssNumberOfMobileStations
.1.3.6.1.4.1.14179.2.1.1.1.38.1 = Counter32: 6
.1.3.6.1.4.1.14179.2.1.1.1.38.2 = Counter32: 0
The OIDs to be configured in the discovery exclude the index part (the number at the end), so just the following are needed:
# OID to acquire the SSID name
.1.3.6.1.4.1.14179.2.1.1.1.2
# OID to acquire the number of clients per SSID
.1.3.6.1.4.1.14179.2.1.1.1.38
Step 2: Create the Discovery
Now, let's actually create the discovery.
First, navigate to [Data collection] > [Templates] > [Discovery] of the desired template > click [Create discovery rule] to create a new discovery rule.
The important part here is the [SNMP OID]. By defining a macro here, you can use a macro with the same name in the items created under this discovery.
In this case, since we want to acquire items per SSID (i.e., include the SSID name in the item name), I defined a macro called {#SSIDNAME} as follows. The corresponding OID is the "OID to acquire the SSID name" obtained earlier.
# SNMP OID
discovery[{#SSIDNAME},.1.3.6.1.4.1.14179.2.1.1.1.2]

After creating the discovery rule, the next step is to create the item.
Click on [Item prototypes] > [Create item prototype] within the discovery rule you just created.
The key points here are the following three: [Name], [Key], and [SNMP OID].
In the [Name], you can use the macro defined earlier. If you set it here, the SSID name will be automatically assigned to the acquired items.
For the [Key] and [SNMP OID], we set the index value corresponding to the SSID name, so we use the default macro {#SNMPINDEX}. Note that for [SNMP OID], we use the "OID to acquire the number of clients per SSID" obtained in the previous section.
# Name
SSID {#SSIDNAME}: Number of clients
# Key
cbw150ax.bsnDot11EssNumberOfMobileStations.[{#SNMPINDEX}]
# SNMP OID
.1.3.6.1.4.1.14179.2.1.1.1.38.{#SNMPINDEX}

Step 3: Checking the acquired data
Now the discovery creation is complete.
Navigate to [Monitoring] > [Latest data], and if the values are correctly retrieved, you're all set!

Note: The SSID names are blurred for security reasons, but the content is displayed correctly.
Sample
I've created a template that includes the discovery rule made in this procedure, so I'll leave it here.
That's all.
Discussion