Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-21981

Template postgresql: pg_isready generate FATAL: database "zabbix" does not exist

    XMLWordPrintable

Details

    • Problem report
    • Status: Closed
    • Trivial
    • Resolution: Won't fix
    • None
    • None
    • None
    • None

    Description

      Hello,

       

      In the Template PostgreSQL by zabbix agent we deployed the template_db_postgresql.conf  file on our zabbix agent.

      In this file there is an entry for the the pg_isready "ping": 

      UserParameter=pgsql.ping[*], pg_isready -h "$1" -p "$2"
       

      We saw on it that we only pass 2 parameters the hostname and the postgresql port.

      Since our Zabbix agent is running under zabbix user this command is run towards the PostgreSQL server with the user zabbix and it is looking for the database zabbix which doesn't exist. By default it assume that the DB to use is the username.

      The test is returning the right information:

      localhost:5432 - accepting connections 

      even if the database doesn't exist, which is nice but since the database doesn't exist the postgresql.log is filled every minutes with: FATAL: database "zabbix" does not exist

      The solution is then to change the template_db_postgresql.conf file as follow:

      Change the items: Status: Ping
      Key: pgsql.ping["\\{$PG.HOST}","\\{$PG.PORT}","\\{$PG.DB}"]

      UserParameter=pgsql.ping[*], pg_isready -h "$1" -p "$2" -d "$3"
      

      Can you please include this change in the next template release?

      Attachments

        Activity

          People

            zabbix.support Zabbix Support Team
            Circle Pr2
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: