Ad Widget

Collapse

Zabbix Server (composed) problem with DNS resolution

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kingfisher77
    Junior Member
    • Aug 2023
    • 2

    #1

    Zabbix Server (composed) problem with DNS resolution

    Zabbix Notification: PostgreSQL database "zabbix" on "postgres:5432" is not available: could not translate host name "postgres" to address: Name does not resolve​
    This is what we get randomly (1-3 times per day) in a Docker setup. This messages comes as a notification and as an entry in the Zabbix Server log. Postgres is running. System log and docker environment is inconspicuous.

    Otherwise - the Zabbix server, the auto-registration, the templates, the active and passive elements, the triggers, the notifications, the graphical user interface - everything works fine.

    The VM size at Hetzner Cloud is comfortable (ccx13) for what we do with Zabbix (~20 Linux servers, some network devices).
    • Docker 24.0.5 (Ubuntu 22.4.3)
    • Zabbix 6.4
    • Postgres 14

    The docker-compose.yml is based on the official example.

    We run almost all of our services with Docker. The Zabbix setup is the first setup that has this error.

    Does anyone have any idea what can cause this error?

    PHP Code:
    services:

      
    postgres:
        
    hostnamepostgres
        restart
    always
        image
    postgres:14-alpine
        volumes
    :
          - 
    postgres:/var/lib/postgresql/data
        env_file
    :
          - ./
    env_vars/.env_pgsql
        secrets
    :
          - 
    POSTGRES_USER
          
    POSTGRES_PASSWORD
        healthcheck
    :
          
    test: ["CMD-SHELL""pg_isready --dbname=$${POSTGRES_DB} --username=$${PGSQL_USER}"]
          
    interval60s
          timeout
    5s
          retries
    3
        stop_grace_period
    1m​

      server
    :
        
    hostnamezabbix
        image
    zabbix/zabbix-server-pgsql:alpine-6.4-latest
        restart
    always
        ports
    :
          - 
    10051:10051
        env_file
    :
          - ./
    env_vars/.env_srv
          
    - ./env_vars/.env_pgsql
        secrets
    :
          - 
    POSTGRES_USER
          
    POSTGRES_PASSWORD
        volumes
    :
          - 
    server-usr-lib:/usr/lib/zabbix
          
    server-var-lib:/var/lib/zabbix
        depends_on
    :
          - 
    postgres
        
    #ulimits:
        #  nproc: 65535
        #  nofile:
        #    soft: 20000
        #    hard: 40000
        #deploy:
        #  resources:
        #    limits:
        #      cpus: '0.70'
        #      memory: 1G
        #    reservations:
        #      cpus: '0.5'
        #      memory: 512M
        
    sysctls:
          - 
    net.ipv4.ip_local_port_range=1024 65000
          
    net.ipv4.conf.all.accept_redirects=0
          
    net.ipv4.conf.all.secure_redirects=0
          
    net.ipv4.conf.all.send_redirects=0​

    volumes
    :
      
    postgres:
      
    server-usr-lib:
      
    server-var-lib:

    ###
    ### Networks
    ###
    networks:
      default:
        
    enable_ipv6true
        ipam
    :
          
    driver: default
          
    config:
            - 
    subnetfd00:5c32:de45::/80
              gateway
    fd00:5c32:de45::1
      traefik
    :
        
    externaltrue

    secrets
    :
      
    POSTGRES_USER:
        
    file: ./env_vars/.POSTGRES_USER
      POSTGRES_PASSWORD
    :
        
    file: ./env_vars/.POSTGRES_PASSWORD​ 
Working...