Ad Widget

Collapse

SNMP Item (ifphysaddress) returns blank or incorrect data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • james.cook000@gmail.com
    Member
    • Apr 2018
    • 49

    #1

    SNMP Item (ifphysaddress) returns blank or incorrect data

    I have been unable to collect and store SNMP ifPhysAddress correctly as it either shows as blank or bad data.

    When performing the snmpwalk on a specific oid I get the following:

    snmpwalk -v2c -c 'XXXXXXX' XXX.XXX.XXX.XXX .1.3.6.1.2.1.2.2.1.6.8
    IF-MIB::ifPhysAddress.8 = STRING: 6c:b2:ae:98:a3:1c

    When defining the Zabbix SNMPv2 item .1.3.6.1.2.1.2.2.1.6.8 I get the following:

    l????

    When query the database for the raw data I get the following:

    l????\x1C

    If the item is defined as an SNMPv3 item the data is returned as blank.

    My environment is:

    Zabbix 4.0.7
    Postgres 11
    Centos 7

    Has anyone else experienced this?
  • james.cook000@gmail.com
    Member
    • Apr 2018
    • 49

    #2
    I have done some additional testing and debugging and found that in the same Zabbix environment the monitored item works on the server and does not work on the proxy.

    I turned on debug information for the pollers on the server and proxy and received the following information:

    Server (Works):

    4895:20190820:160834.805 zbx_snmp_get_octet_string() full value:'STRING: 0:1d:46:8d:a:c0' hint:'1x:'
    4895:20190820:160834.805 End of zbx_snmp_get_octet_string():'0:1d:46:8d:a:c0'
    4895:20190820:160834.805 End of zbx_snmp_set_result():SUCCEED

    Proxy (Broken):

    24755:20190820:160654.761 zbx_snmp_get_octet_string() full value:'0:1d:46:8d:a:c0' hint:'1x:'
    24755:20190820:160654.761 End of zbx_snmp_get_octet_string():''
    24755:20190820:160654.761 End of zbx_snmp_set_result():SUCCEED

    It looks like it is collecting the information however is not converting it correctly?

    Comment

    • james.cook000@gmail.com
      Member
      • Apr 2018
      • 49

      #3
      Some further information.

      I looked at the Zabbix source (src/zabbix_server/poller/checks_snmp.c) in the function zbx_snmp_get_octet_string() to see why this is not being handled correctly (Looking at the above log explains it).

      The if/else statements look for a hint and for specific strings in the buffer (i.e. Hex-String:, STRING:, OID:, BITS: and converts as required.

      If there is no hint or the buffer does not contain the required strings it defaults to the else clause which treats it differently and failing in this case.

      Now looking at the snmpwalk output on the server and proxy, they show identicle output and both report the value as 'STRING: 0:1d:46:8d:a:c0', so for some reason Zabbix is not.

      Has anyone come across this before in Centos?

      Comment

      Working...