Ad Widget

Collapse

Issue with zabbix-agent2-plugin-postgresql.x86_64 6.0.18-release1.el8

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alex_SYB
    Senior Member
    • Feb 2012
    • 133

    #1

    Issue with zabbix-agent2-plugin-postgresql.x86_64 6.0.18-release1.el8

    Hi



    upgraded to zabbix-agent2-plugin-postgresql.x86_64 6.0.18-release1.el8 i started to get errors

    from the postgres template I have used this as a test



    This used to work

    zabbix_get -s pgsql -k'pgsql.archive["tcp://localhost:5432","zabbix","<password>"]'

    I get this error

    ZBX_NOTSUPPORTED: Connection failed: failed to connect to `host=localhost user=zabbix database=user=zabbix`: server error (FATAL: database "user=zabbix" does not exist (SQLSTATE 3D000)).


    notice database = user=zabbix, looks to me like the default database is not being used !



    If i change to this it works now

    zabbix_get -s pgsql -k'pgsql.archive["tcp://localhost:5432","zabbix","<password>","postgres"]'



    thanks
  • ivanco
    Junior Member
    • May 2023
    • 5

    #2
    Got the same problem. It looks like incompatibility in default Agent2 config and template.
    And tried to get data in cli:
    Code:
    root@host:/var/log/postgresql# zabbix_agent2 -t pgsql.archive["tcp://localhost:5432","zbx_monitor","zabbix"]
    pgsql.archive[tcp://localhost:5432,zbx_monitor,zabbix][m|ZBX_NOTSUPPORTED] [Connection failed: failed to connect to `host=localhost user=root database=user=zbx_monitor`: server error (FATAL: role "root" does not exist (SQLSTATE 28000)).]
    I modified the query with 4 args, not 3. Success.
    Code:
    root@host:/var/log/postgresql# zabbix_agent2 -t pgsql.archive["tcp://localhost:5432","zbx_monitor","zabbix","postgres"]
    pgsql.archive[tcp://localhost:5432,zbx_monitor,zabbix,postgres][s|{"archived_count":0,"failed_count":0,"count_fil e s":0,"size_files":0}]
    Then I modified default config of /etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf. Added:
    Code:
    Plugins.PostgreSQL.Default.Database=postgres
    After that issue was solved.​

    Comment

    • Alex_SYB
      Senior Member
      • Feb 2012
      • 133

      #3
      Didn't know about the last bit the config option. I just updated the template to include the PG_Database as option 4 - it was needed before

      Comment

      Working...