Ad Widget

Collapse

Zabbix postgres agent Unsupported item key

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mlrtime
    Junior Member
    • Aug 2019
    • 15

    #1

    Zabbix postgres agent Unsupported item key

    I have a agent and server, both are communicating ok. I have the official postgres template added to the server. I have another host that is connecting fine, however this host is giving me unsupported item key.

    Code:
    27942:20190820:140303.580 item "hostA:pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.DB}"]" became not supported: Unsupported item key.
    When I run zabbix_get on the server, everything returns fine

    [root@zabbix ~]# zabbix_get -s hostA -p 10050 -k "pgsql.bgwriter["127.0.0.1","5432","zbx_monitor","postgres"]"
    {"checkpoints_timed":31740,"checkpoints_req":11 4," checkpoint_write_time":880725336,"checkpoint_sync_ time":129344,"buffers_checkpoint":163658883072,"bu ffers_clean":274905767936,"maxwritten_clean":26391 4,"buffers_backend":1046067863552,"buffers_backe nd _fsync":0,"buffers_alloc":48555576836096}

    Also, when the zabbix server log shows unsupported item key, I do not see any requests at all in the agent log, I have it at Loglevel 4. When I run zabbix_get I do see the items in the log:

    Code:
    zabbix_agentd.log: 13949:20190820:101651.248 Requested [pgsql.bgwriter[127.0.0.1,5432,zbx_monitor,postgres]]
    zabbix_agentd.log: 13949:20190820:101651.248 In zbx_popen() command:' psql -qtAX -h 127.0.0.1 -p 5432 -U zbx_monitor -d postgres -f "/var/lib/zabbix/postgresql/pgsql.bgwriter.sql"'
    zabbix_agentd.log: 13949:20190820:101651.273 EXECUTE_STR() command:' psql -qtAX -h 127.0.0.1 -p 5432 -U zbx_monitor -d postgres -f "/var/lib/zabbix/postgresql/pgsql.bgwriter.sql"' len:291 cmd_result:'{"checkpoints_timed"'
    Any ideas how I can debug this further, does mean the checks aren't making it ?

    Zabbix Agent and Server version: 4.2.5
    Last edited by mlrtime; 20-08-2019, 23:39.
  • hokiecolt67
    Junior Member
    • Aug 2019
    • 13

    #2
    mirtime - I'm new to this forum and I was looking at your post. Is it supposed to be ,"{$PG.DB}" and not ,"{$PG.D B}" Are you using macros to store the values? I would check that for the host having issues. Could be a spelling error or typo.

    Comment

    • mlrtime
      Junior Member
      • Aug 2019
      • 15

      #3
      I'm sorry that looks like a bug while pasting, here is the level 5 debug from server log

      Code:
      14448:20190820:213528.864 In get_value_agent() host:'hostA' addr:'0.0.0.0' key:'system.cpu.util[,idle]' conn:'unencrypted'
      14450:20190820:213528.874 In get_value_agent() host:'hostA' addr:'0.0.0.0' key:'pgsql.config.hash["127.0.0.1","5432","zbx_monitor","postgres"]' conn:'unencrypted'
      14450:20190820:213528.876 Item [hostA:pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.D B}"]] error: Unsupported item key.
      14440:20190820:213528.888 End of evaluate() error:'Cannot evaluate expression: "Cannot evaluate function "hostA:pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.D B}"].strlen()": item is not supported.".'
      14440:20190820:213528.888 evaluate_expressions():expression [(ZBX_UNKNOWN1)=1 and (ZBX_UNKNOWN0)>0] cannot be evaluated: Cannot evaluate expression: "Cannot evaluate function "hostA:pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.D B}"].strlen()": item is not supported.".
      I don't see anything in the agent log and zabbix_get works


      Code:
      # zabbix_get -s hostA -p 10050 -k "pgsql.config.hash["127.0.0.1","5432","zbx_monitor","postgres"]"
      35ac93e301881fad0433ad008e330802
      Last edited by mlrtime; 20-08-2019, 23:50.

      Comment

      • hokiecolt67
        Junior Member
        • Aug 2019
        • 13

        #4
        mirtime - I would compare the macros for the system that works with the system that doesn't. Still could be a typo.

        Comment

        • mlrtime
          Junior Member
          • Aug 2019
          • 15

          #5
          Thanks for the suggestion, the host macros are all empty, the macros inherited from the template are all the defaults, they are identical between the two hosts.

          Click image for larger version

Name:	Capture.PNG
Views:	6800
Size:	105.2 KB
ID:	384696

          Comment

          • mlrtime
            Junior Member
            • Aug 2019
            • 15

            #6
            So my colleague found the problem.

            In Configuration->Hosts->Agent Interfaces the IP address was 0.0.0.0, as soon as we changed this to the ip address of the agent it worked.

            Even though, ListenIP=0.0.0.0 in zabbix_agentd.conf

            This also seems to be the default Agent interface when auto adding.
            Last edited by mlrtime; 22-08-2019, 23:13.

            Comment

            Working...