Environment:
Zabbix 7.0.1
SNMP Agents
No Proxys
Cisco Network Equipment only.
Objective:
1. Create an Item Prototype that generates an Item Per Mac address discovered by a host: OID - 1.3.6.1.2.1.17.4.3.1.1
2. Have the value returned to those items be the physical interface name (I.E. GigabitEthernet0/1) on the switch(host) associated with the outbound path to that mac: OID - 1.3.6.1.2.1.2.2.1.2
Problem:
The snmpwalk for 1.3.6.1.2.1.2.2.1.2 provides "Next OIDs" that do not correspond with any identifiers of 1.3.6.1.2.1.17.4.3.1.1, but instead lead to a relationship with additional OIDs.
The Data Relationships:
1. snmpwalk 1.3.6.1.2.1.17.4.3.1.1 - provides the list of discovered mac addresses with the "NEXT OIDS" being the mac address represented in decimal and the value being the mac address as a hex string.
Example(sanitized): SNMPv2-SMI::mib-2.17.4.3.1.1.255.255.255.255.255.255 = Hex-STRING: FF FF FF FF FF FF
2. snmpwalk 1.3.6.1.2.1.17.4.3.1.2 - Returns the mac address to port mapping index. (macs are in decimal form, value is an index for snmp off IF-MIB)
Example(sanitized): SNMPv2-SMI::mib-2.17.4.3.1.2.255.255.255.255.255.255 = INTEGER: 80
3. snmpwalk 1.3.6.1.2.1.17.1.4.1.2 - Returns the mapping of port oids to port indexs
Example(sanitized): SNMPv2-SMI::mib-2.17.1.4.1.2.80 = INTEGER: 5004
4. snmpwalk 1.3.6.1.2.1.2.2.1.2 - Returns the name of the interface based on the index retrieved in 3.
Example(sanitized): IF-MIB::ifDescr.5004 = STRING: FastEthernet0/1
Following the Data:
The "Sub OID" of 1 (example: 255.255.255.255.255.255) can be fed to 2 as shown in its example. The Value returned by 2 is the next needed index (Example: "80"). That index may be fed to 3 as shown in the example. That calls return is the next needed index (Example: "5004"). The last step is to request the name of the interface in step 4 using the value returned by 3 as seen in 4's example.
By following the snmp response data the answer found is: Mac address: FF:FF:FF:FF:FF:FF is reached through port FastEthernet0/1
Question:
How can I use Zabbix to dynamically create MAC address items for a switch, each with a stored value of the uplink interface needed for the switch to reach that MAC address?
I.E. Name: "Mac address: FF:FF:FF:FF:FF:FF" Value: "FastEthernet0/1"
I cannot seem to find how in zabbix preprocessing or LLD Macros to traverse data relationships in this way. My attempts keep bringing me to snmpwalk to json, followed by jsonpath, but jsonpath cannot key into any of my macro variables, zabbix throws a context error any time I try to use variables in jsonpath.
Help please....
Comment