Ad Widget

Collapse

I can not configure Zabbix 4.2 frontend for Postgres 11 on CentOS 7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DmitryBobrovsky
    Junior Member
    • Aug 2017
    • 17

    #1

    I can not configure Zabbix 4.2 frontend for Postgres 11 on CentOS 7

    OS CentiOS 7. I Install Zabbix 4.2 according to instructions - Download and install Zabbix and Postgres 11 - Linux downloads (Red Hat family).
    =================================================
    In short, it turns out like this:
    # rpm -Uvh https://repo.zabbix.com/zabbix/4.2/r...el7.noarch.rpm
    # yum clean all
    # yum -y install zabbix-server-pgsql zabbix-web-pgsql zabbix-agent
    # yum install https://download.postgresql.org/pub/...est.noarch.rpm
    # yum install postgresql11
    # yum install postgresql11-server
    # /usr/pgsql-11/bin/postgresql-11-setup initdb
    # systemctl enable postgresql-11
    # systemctl start postgresql-11
    # sudo -u postgres createuser --pwprompt zabbix
    # sudo -u postgres createdb -O zabbix zabbix
    # zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix
    # systemctl enable zabbix-server zabbix-agent httpd
    # systemctl restart zabbix-server zabbix-agent httpd
    ==========================================

    postgresql.conf
    listen_addresses = '*'

    pg_hba.conf (I already allowed everything that is possible)
    local all all peer
    host all all 127.0.0.1/32 md5

    local replication all peer
    host replication all 127.0.0.1/32 ident
    host replication all ::1/128 ident

    host all all 0.0.0.0/0 md5

    zabbix_server.conf
    DBHost=
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix

    When I try to install the frontend, in step «Configure DB connection», I get an error all the time: Cannot connect to the database (see pic.)

    I CAN connect to the database from my computer, but installer localy cannot.

    Why can't the installer connect to the database? Maybe it problem package - zabbix-web-pgsql?


    Attached Files
  • DmitryBobrovsky
    Junior Member
    • Aug 2017
    • 17

    #2
    I have Zabbix 4.0 он Astra Linux (Debian) there is file /etc/zabbix/web/zabbix.conf.php and here it doesn’t exist at all, this is only maintenance.inc.php - maybe this is the reason?
    Last edited by DmitryBobrovsky; 26-08-2019, 17:00.

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #3
      The file /etc/zabbix/web/zabbix.conf.php is automatically generated and saved after confirming the connection to the DBMS.
      Is any error output to the httpd error log (/var/log/httpd/error_log)?

      Comment

      • DmitryBobrovsky
        Junior Member
        • Aug 2017
        • 17

        #4
        Originally posted by Atsushi
        The file /etc/zabbix/web/zabbix.conf.php is automatically generated and saved after confirming the connection to the DBMS.
        Is any error output to the httpd error log (/var/log/httpd/error_log)?
        Restart httpd, delete all logs, delete cookies in browser - the error is repeated, but I do not see any errors in the log

        Code:
        [B]# cat /var/log/httpd/error_log[/B]
        [Tue Aug 27 10:14:07.438834 2019] [suexec:notice] [pid 8269] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
        AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.26.12.25. Set the 'ServerName' directive globally to suppress this message
        [Tue Aug 27 10:14:07.472701 2019] [lbmethod_heartbeat:notice] [pid 8269] AH02282: No slotmem from mod_heartmonitor
        [Tue Aug 27 10:14:07.501589 2019] [mpm_prefork:notice] [pid 8269] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
        [Tue Aug 27 10:14:07.501641 2019] [core:notice] [pid 8269] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
        [root@zabbix httpd]# cat /var/log/httpd/error_log
        [Tue Aug 27 10:14:07.438834 2019] [suexec:notice] [pid 8269] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
        AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.26.12.25. Set the 'ServerName' directive globally to suppress this message
        [Tue Aug 27 10:14:07.472701 2019] [lbmethod_heartbeat:notice] [pid 8269] AH02282: No slotmem from mod_heartmonitor
        [Tue Aug 27 10:14:07.501589 2019] [mpm_prefork:notice] [pid 8269] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
        [Tue Aug 27 10:14:07.501641 2019] [core:notice] [pid 8269] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
        [root@zabbix httpd]# cat /var/log/httpd/error_log
        [Tue Aug 27 10:14:07.438834 2019] [suexec:notice] [pid 8269] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
        AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.26.12.25. Set the 'ServerName' directive globally to suppress this message
        [Tue Aug 27 10:14:07.472701 2019] [lbmethod_heartbeat:notice] [pid 8269] AH02282: No slotmem from mod_heartmonitor
        [Tue Aug 27 10:14:07.501589 2019] [mpm_prefork:notice] [pid 8269] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
        [Tue Aug 27 10:14:07.501641 2019] [core:notice] [pid 8269] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

        Comment

        • Jason
          Senior Member
          • Nov 2007
          • 430

          #5
          Have you configured and tested password login for postgres from localhost?

          Comment

          • DmitryBobrovsky
            Junior Member
            • Aug 2017
            • 17

            #6
            Thank. Executed

            Code:
            [B]# su - postgres[/B]
            Last login: Mon Aug 26 15:55:55 MSK 2019 on pts/0
            -bash-4.2[B]$ psql -h localhost -d zabbix -U zabbix[/B]
            [COLOR=#FF0000]psql: FATAL:  no pg_hba.conf entry for host "::1", user "zabbix", database "zabbix", SSL off[/COLOR]
            -bash-4.2$
            It seems that Postgres is listening on ip6 too.

            Change in pg_hba.conf
            Code:
            local all all trust
            host all all ::1/128 trust
            it worked. I installed frontend.

            Does anyone know how to disable IP6 for Postgres?

            Comment

            • Hamardaban
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • May 2019
              • 2713

              #7
              For best performance, I recommend using socket communication with the database server

              Comment

              • DmitryBobrovsky
                Junior Member
                • Aug 2017
                • 17

                #8
                Originally posted by Hamardaban
                For best performance, I recommend using socket communication with the database server
                How to configure it?

                Comment

                • DmitryBobrovsky
                  Junior Member
                  • Aug 2017
                  • 17

                  #9
                  Originally posted by splitek
                  https://www.postgresql.org/docs/curr...onnection.html
                  listen_addresses (string)
                  Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications. The value takes the form of a comma-separated list of host names and/or numeric IP addresses. The special entry * corresponds to all available IP interfaces. The entry 0.0.0.0 allows listening for all IPv4 addresses and :: allows listening for all IPv6 addresses. If the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. The default value is localhost, which allows only local TCP/IP “loopback” connections to be made. While client authentication (Chapter 20) allows fine-grained control over who can access the server, listen_addresses controls which interfaces accept connection attempts, which can help prevent repeated malicious connection requests on insecure network interfaces. This parameter can only be set at server start.
                  Yes, I did just that. And generally disabled IP6 in OS

                  Code:
                  nano /etc/sysctl.conf
                  
                  net.ipv6.conf.all.disable_ipv6 = 1
                  net.ipv6.conf.default.disable_ipv6 = 1

                  Comment

                  Working...