-
Problem report
-
Resolution: Fixed
-
Trivial
-
None
-
6.4.9, 7.0.0alpha8
-
None
Steps to reproduce:
- Instal MIB files to zabbix server, restart zabbix server process
- create walk[1.3.6.1.2.1.2.2.1.6] item for some SNMP device
- Uninstal MIB files from zabbix server or change IF-MIB.txt file as described later, restart zabbix server process
- compare values before and after MIB files uninstallation
First result:
.1.3.6.1.2.1.2.2.1.6.1 = STRING: 8:55:31:75:2f:b6
Second result:
.1.3.6.1.2.1.2.2.1.6.1 = Hex-STRING: 08 55 31 75 2F B6
Expected:
same result independent on MIB files in OS.
Description:
If I use snmp agent with get or walk item for aquiring MAC addresses from device, A got diferent results that depends on lib net-snmp configuration or on snmp.conf file.
For example:
If there are no MIB files imported in OS - the result for getting MAC addres from item: 1.3.6.1.2.1.2.2.1.6[index,1.3.6.1.2.1.2.2.1.2,"ether2"] is 08 55 31 75 2F B2
Result for walk item: walk[1.3.6.1.2.1.2.2.1.6] is table with Hex-STRING values:
.1.3.6.1.2.1.2.2.1.6.1 = Hex-STRING: 08 55 31 75 2F B6
.1.3.6.1.2.1.2.2.1.6.2 = Hex-STRING: 08 55 31 75 2F B7
.1.3.6.1.2.1.2.2.1.6.3 = Hex-STRING: 08 55 31 75 2F B1
.1.3.6.1.2.1.2.2.1.6.4 = Hex-STRING: 08 55 31 75 2F B2
But if there are MIB files imported - in my example IF-MIB with part, that defines ifPhysAddress as PhysAddress syntax:
ifPhysAddress OBJECT-TYPE
SYNTAX PhysAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The interface's address at its protocol sub-layer. For
example, for an 802.x interface, this object normally
contains a MAC address. The interface's media-specific MIB
must define the bit and byte ordering and the format of the
value of this object. For interfaces which do not have such
an address (e.g., a serial line), this object should contain
an octet string of zero length."
::= { ifEntry 6 }
Then PhysAddres is converted to STRING and Zabbix returns value converted to string: 8:55:31:75:2f:b2 - for same item
And walk item returns:
.1.3.6.1.2.1.2.2.1.6.1 = STRING: 8:55:31:75:2f:b6
.1.3.6.1.2.1.2.2.1.6.2 = STRING: 8:55:31:75:2f:b7
.1.3.6.1.2.1.2.2.1.6.3 = STRING: 8:55:31:75:2f:b1
.1.3.6.1.2.1.2.2.1.6.4 = STRING: 8:55:31:75:2f:b2
That's problem, when you need to compare MAC address - you need to use same MAC address representation in any case. in any part of DB. I use MAC address in script item to find device connected on port so I need same syntax anywhere.
Asking walk for ARP chche MAC addresses - walk[.1.3.6.1.2.1.17.4.3.1.1] returns Hex-STRINGS correctly with or without MIB files loaded, because syntax defined in MIB file is: "SYNTAX MacAddress""
I know, that "SYNTAX PhysAddress" comes from RFC 1213 definition. But can zabbix ignore this snmp library setting and provide non-converted value to item value?
I know, I can use some workarounds:
1) Change IF-MIB to use syntax:
ifPhysAddress OBJECT-TYPE
SYNTAX MacAddress
2) Delete IF-MIB file
3) Create preprocessing for MAC address normalization to fullfill regular expression ^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$
But every workaround has some advantages and disadvantages.
Can zabbix provide Hex-STRING item without conversion to STRING independently on MIB files and snmp.conf setup?
- duplicates
-
ZBX-17382 SNMP Text values are shown as HEX (or dots) values when contains non-english characters (non ASCII7)
- Closed