Ad Widget

Collapse

Zabbix 2 Docker Containers cannot find eachother.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SHLelieveld
    Junior Member
    • Aug 2021
    • 1

    #1

    Zabbix 2 Docker Containers cannot find eachother.

    Hello All,

    Thanks for checking and hopefully helping with our issue.

    We have an Ansible playbook to start 4 zabbix containers:
    -Zabbix-server
    -Zabbix-frontend
    -Zabbix-snmptraps
    -Zabbix-java-gateway:

    This in done through the following playbook parts:

    - name: Start zabbix container
    docker_container:
    name: zabbix-server
    image: zabbix-server:latest
    state: started
    restart: true
    restart_policy: unless-stopped
    hostname: zabbix-server-container
    volumes:
    - /usr/share/zabbix/snmp/mibs:/var/lib/zabbix/mibs
    - /usr/share/zabbix/alertscripts:/usr/lib/zabbix/alertscripts
    - /usr/share/zabbix/externalscripts:/usr/lib/zabbix/externalscripts
    - /etc/openldap/certs:/var/lib/zabbix/ssl/certs
    ports:
    - "10051:10051"
    etc_hosts:
    "viper-server-remote": "{{ viperremote }}"
    env:
    MYSQL_DATABASE: "zabbix_{{ location }}"
    MYSQL_USER: "{{ zabbix_db_user }}_{{ location }}"
    MYSQL_PASSWORD: "{{ zabbix_db_password }}"
    DB_SERVER_HOST: "172.17.0.1"
    DB_SERVER_PORT: "3306"
    ZBX_DEBUGLEVEL: "3"
    ZBX_STARTPOLLERS: "10"
    ZBX_STARTPOLLERSUNREACHABLE: "10"
    ZBX_STARTJAVAPOLLERS: "5"
    ZBX_STARTVMWARECOLLECTORS: "1"
    ZBX_IPMIPOLLERS: "1"
    ZBX_STARTPINGERS: "5"
    ZBX_STARTESCALATORS: "25"
    ZBX_CACHESIZE: "32M"
    ZBX_TIMEOUT: "30"
    ZBX_JAVAGATEWAY_ENABLE: "true"
    ZBX_JAVAGATEWAY: "zabbix-java-gateway"
    ZBX_JAVAGATEWAYPORT: "10052"

    vars:
    ansible_python_interpreter: /usr/bin/python3
    tags:
    - zabbix

    ##Don't mind indentations as they got lost in copy paste.

    - name: Start zabbix java gateway container
    docker_container:
    name: zabbix-java-gateway
    image: zabbix/zabbix-java-gateway:alpine-5.0-latest
    state: started
    restart: true
    restart_policy: unless-stopped
    hostname: zabbix-java-gateway
    links:
    - "zabbix-server"
    vars:
    ansible_python_interpreter: /usr/bin/python3
    tags:
    - zabbix

    ##Don't mind indentations as they got lost in copy paste.

    These are 2 of the containers to link to eachother.
    The containers start with no obvious errors in the log files. But in zabbix the JMX indicater remains red with the following message: "cannot resolve [zabbix-java-gateway]"



    When I run docker inspect zabbix-java-gateway:
    (selection)

    "Hostname": "zabbix-java-gateway",
    //
    "Ports": {
    "10052/tcp": null
    },
    //
    "IPAddress": "172.17.0.4",


    What do I do wrong?

    All using zabbix LTS 5.0.x

    Thanks for the help.
Working...