Ad Widget

Collapse

[m|ZBX_NOTSUPPORTED] [Invalid item key format.]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmorgan
    Junior Member
    • Sep 2017
    • 26

    #1

    [m|ZBX_NOTSUPPORTED] [Invalid item key format.]

    We're using unifi.proxy to monitor our Ubiquiti equipment and we've run into a problem after upgrading to Zabbix 4.0.1. The problem is that any item key that has an array reference in it is not working.

    For instance,

    zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t unifi.proxy[get,ugw,<site_name>,"port_table.[name=lan].ip",<device_id>] returns [m|ZBX_NOTSUPPORTED] [Invalid item key format.].

    But,

    zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t unifi.proxy[get,ugw,<site_name>,"adopted",<device_id>] returns [s|1] which is correct.

    I think problem is the extra set of braces (i.e. [name=lan] ) in the key. I've experimented and as long as there are no other braces except the ones enclosing the unifi.proxy parameters, the key will work.

    For example: zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t unifi.proxy[get,ugw,<site_name>,port_table.ip,<device_id>] returns [s|192.168.x.x] which is the correct first item in the array.

    Unfortunately, I need the second item in the array. But, as mentioned before, adding the [<array_position>] reference causes an invalid item key exception. This used to work before the Zabbix upgrade. Am I just not using the correct syntax (port_table.[name=lan].ip) for the key? Which begs the question, what's the correct syntax?

    Or, has there been a change in Zabbix to the format of the item keys that will not allow the braces necessary to reference a specific json array element?

    Thanks.
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Agent should handle it fine, if in Frontend configuration you have the 4th parameter quoted. But if you want to run the check manually you must ensure the quotes are getting to agent by escaping them. Try:
    Code:
    zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t unifi.proxy[get,ugw,<site_name>,\"port_table.[name=lan].ip\",<device_id>]
    Bash removes the quotes when it parses command-line unless they are escaped.
    Last edited by dimir; 22-11-2018, 11:47.

    Comment

    • mmorgan
      Junior Member
      • Sep 2017
      • 26

      #3
      Thank you for your reply. Everything seems to be working again somehow. I don't know why; I haven't done anything to fix it. So, it must be a miracle...maybe? Anyhow, there is great joy and happiness!

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        weeeeeeeeeeeeeee!

        Comment

        • sadman
          Senior Member
          • Dec 2010
          • 1611

          #5
          Originally posted by mmorgan
          Unfortunately, I need the second item in the array. But, as mentioned before, adding the [<array_position>] reference causes an invalid item key exception. This used to work before the Zabbix upgrade. Am I just not using the correct syntax (port_table.[name=lan].ip) for the key? Which begs the question, what's the correct syntax?
          No way to get exactly 2nd elementh of the port's array. Using any unique value of the port's subkey is way by design.

          Comment

          Working...