Ad Widget

Collapse

new installation - log shows zabbix user cannot authenticate to postgres database

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gjanssen
    Junior Member
    • Oct 2022
    • 2

    #1

    new installation - log shows zabbix user cannot authenticate to postgres database

    I am new to Zabbix, but have reviewed the documentation and closely followed the installation and deployment guidelines.
    The zabbix database cannot be accessed by the zabbix user. I even reset the zabbix postgres user's password - log still says "no".

    systeminfo
    Code:
    grant@zabbix:~[20221017-9:46][#242]$ cat /etc/almalinux-release
    AlmaLinux release 9.0 (Emerald Puma)
    grant@zabbix:~[20221017-9:46][#243]$ rpm -qa | grep -e postgresql-server -e zabbix-release
    zabbix-release-6.3-1.el9.noarch
    postgresql-server-13.7-1.el9_0.x86_64
    grant@zabbix:~[20221017-9:46][#244]$​
    zabbix configuration, logs, postgres
    Code:
    grant@zabbix:~[20221017-9:30][#231]$ sudo cat /etc/zabbix/zabbix_server.conf | grep DB | grep -v \#
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=************
    DBPort=5432
    grant@zabbix:~[20221017-9:30][#232]$ sudo netstat -tnlp | grep 5432
    tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 14311/postmaster
    tcp6 0 0 ::1:5432 :::* LISTEN 14311/postmaster
    grant@zabbix:~[20221017-9:31][#233]$ tail /var/log/zabbix/zabbix_server.log
    14629:20221017:093108.864 database is down: reconnecting in 10 seconds
    14629:20221017:093118.882 [Z3001] connection to database 'zabbix' failed: [0] FATAL: Ident authentication failed for user "zabbix"
    
    14629:20221017:093118.882 database is down: reconnecting in 10 seconds
    14629:20221017:093128.902 [Z3001] connection to database 'zabbix' failed: [0] FATAL: Ident authentication failed for user "zabbix"
    
    14629:20221017:093128.902 database is down: reconnecting in 10 seconds
    14629:20221017:093138.921 [Z3001] connection to database 'zabbix' failed: [0] FATAL: Ident authentication failed for user "zabbix"
    
    14629:20221017:093138.921 database is down: reconnecting in 10 seconds
    grant@zabbix:~[20221017-9:31][#234]$ sudo -i -u postgres psql
    psql (13.7)
    Type "help" for help.
    
    postgres=# \l
    List of databases
    Name | Owner | Encoding | Collate | Ctype | Access privileges
    -----------+----------+----------+-------------+-------------+-----------------------
    postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
    template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
    | | | | | postgres=CTc/postgres
    template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
    | | | | | postgres=CTc/postgres
    zabbix | zabbix | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
    (4 rows)
    
    postgres=# \du
    List of roles
    Role name | Attributes | Member of
    -----------+------------------------------------------------------------+-----------
    postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
    zabbix | | {}
    
    postgres=# \q
    grant@zabbix:~[20221017-9:32][#235]$
    What have I missed?

    thanx

    - grant

  • Answer selected by Markku at 20-10-2022, 06:47.
    gjanssen
    Junior Member
    • Oct 2022
    • 2

    this did indeed remedy my issue - changed host from ident to md5

    Code:
    grant@zabbix:~[20221019-12:32][#255]$ sudo cat /var/lib/pgsql/data/pg_hba.conf | grep -v -e \# -e '^$'
    local all all peer
    host all all 127.0.0.1/32 md5
    host all all ::1/128 md5
    local replication all peer
    host replication all 127.0.0.1/32 ident
    host replication all ::1/128 ident
    grant@zabbix:~[20221019-12:33][#256]$ sudo systemctl restart postgresql.service
    grant@zabbix:~[20221019-12:33][#257]$​
    thank you

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      https://serverfault.com/questions/40...ailed-for-user ?

      Markku

      Comment

      • gjanssen
        Junior Member
        • Oct 2022
        • 2

        #3
        this did indeed remedy my issue - changed host from ident to md5

        Code:
        grant@zabbix:~[20221019-12:32][#255]$ sudo cat /var/lib/pgsql/data/pg_hba.conf | grep -v -e \# -e '^$'
        local all all peer
        host all all 127.0.0.1/32 md5
        host all all ::1/128 md5
        local replication all peer
        host replication all 127.0.0.1/32 ident
        host replication all ::1/128 ident
        grant@zabbix:~[20221019-12:33][#256]$ sudo systemctl restart postgresql.service
        grant@zabbix:~[20221019-12:33][#257]$​
        thank you

        Comment

        Working...