Ad Widget

Collapse

Having trouble in zabbix installation when conecting to postgresql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rafael P Oliveira
    Junior Member
    • Apr 2024
    • 2

    #1

    Having trouble in zabbix installation when conecting to postgresql

    Hello!

    So basically i need a zabbix server running with traefik and postgresql , installed in docker.
    Im new with zabbix and when i was doing my research about installing i found this code for a YML file to do a basic installation.

    This was the code:

    Code:
    version: '3.8'
    
    services:
    # Traefik Reverse Proxy
    traefik:
    image: traefik:v2.9.1
    container_name: traefik
    command:
    - "--api.dashboard=true"
    - "--providers.docker=true"
    - "--entrypoints.web.expose=true"
    - "--entrypoints.web.addr=:80"
    - "--entrypoints.websecure.expose=true"
    - "--entrypoints.websecure.addr=:443"
    - "--certificatesResolvers.zabbix.acme.tls=dnschallenge "
    - "--certificatesResolvers.zabbix.acme.tls.acmeprovider =letsencrypt"
    - "--certificatesResolvers.zabbix.acme.tls.acmeStaging= true" # Set to false for production
    - "--certificatesResolvers.zabbix.acme.tls.dnsconfig=cl oudflare" # Adjust based on your DNS provider
    # Configure your specific DNS challenge details here (refer to Traefik documentation for supported providers)
    ports:
    - "80:80"
    - "443:443"
    volumes:
    - ./traefik.yml:/etc/traefik/traefik.yml:ro # Mount your Traefik configuration file (modify as needed)
    
    # PostgreSQL Database
    postgres:
    image: postgres:14.1-alpine
    container_name: zabbix-postgres
    environment:
    POSTGRES_DB: ${POSTGRES_DB:-zabbix}
    POSTGRES_USER: ${POSTGRES_USER:-zabbix}
    POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-your_password}
    volumes:
    - zabbix-postgres-data:/var/lib/postgresql/data
    
    # Zabbix Server
    zabbix-server:
    image: zabbix/zabbix-server-pgsql:latest
    container_name: zabbix-server
    depends_on:
    - postgres
    environment:
    DB_SERVER_HOST: postgres
    DB_SERVER_PORT: 5432
    DB_NAME: ${POSTGRES_DB:-zabbix}
    DB_USER: ${POSTGRES_USER:-zabbix}
    DB_PASSWORD: ${POSTGRES_PASSWORD:-your_password}
    ZBX_SERVER_NAME: zabbix-server
    ZBX_LISTEN_PORT: 0 # Traefik will route traffic
    volumes:
    - zabbix-server-data:/var/lib/zabbix
    
    # Zabbix Web Interface
    zabbix-web:
    image: zabbix/zabbix-web-nginx-pgsql:latest
    container_name: zabbix-web
    depends_on:
    - zabbix-server
    environment:
    ZBX_SERVER_HOST: zabbix-server
    ZBX_SERVER_PORT: 10051 # Port used for communication with Zabbix server
    DB_SERVER_HOST: postgres
    DB_SERVER_PORT: 5432
    DB_NAME: ${POSTGRES_DB:-zabbix}
    DB_USER: ${POSTGRES_USER:-zabbix}
    DB_PASSWORD: ${POSTGRES_PASSWORD:-your_password}
    PHP_FPM_LISTEN_PORT: 0 # Traefik will route traffic
    
    # Volumes (modify paths as needed)
    volumes:
    zabbix-postgres-data:
    zabbix-server-data:
    unfortunately i get some kind of error in the installation and this is what i get on the docker logs :
    2024-04-12 09:13:53 2024-04-12 08:13:53.695 UTC [105] FATAL: password authentication failed for user "postgres"
    2024-04-12 09:13:53 2024-04-12 08:13:53.695 UTC [105] DETAIL: Role "postgres" does not exist.
    2024-04-12 09:13:53 Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"​

    Help?
Working...