docker-freepbx icon indicating copy to clipboard operation
docker-freepbx copied to clipboard

cannot resolve [zabbix-proxy]

Open Anzic23 opened this issue 4 years ago • 6 comments

Docker version 18.09.8, build 2c0a67b docker-compose version 1.24.0, build 0aa59064 system - Synology DS3615xs (Linux NAS 3.10.105 #23739 SMP Sat May 19 03:07:32 CST 2018 x86_64 GNU/Linux synology_bromolow_3615xs) docker tag version - 4.0.2 2020-03-25 docker-compose.yml

version: '2'

services:
  freepbx-app:
    container_name: freepbx-app
    image: tiredofit/freepbx
    ports:
     #### If you aren't using a reverse proxy
      - 8014:80
     #### If you want SSL Support and not using a reverse proxy
     #- 443:443
      - 5060:5060/udp
      - 5160:5160/udp
      - 18000-18100:18000-18100/udp
     #### Flash Operator Panel
      - 4445:4445
    volumes:
      - ./certs:/certs
      - ./data:/data
      - ./logs:/var/log
      - ./data/www:/var/www/html
     ### Only Enable this option below if you set DB_EMBEDDED=TRUE
     #- ./db:/var/lib/mysql
     ### You can drop custom files overtop of the image if you have made modifications to modules/css/whatever - Use with care
     #- ./assets/custom:/assets/custom

    environment: 
      - VIRTUAL_HOST=freepbx.huako.ru
      - VIRTUAL_NETWORK=zabbix-proxy
     ### If you want to connect to the SSL Enabled Container 
     #- VIRTUAL_PORT=443
     #- VIRTUAL_PROTO=https
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=freepbx.huako.ru
      - [email protected]

      - ZABBIX_HOSTNAME=freepbx-app

      - RTP_START=18000
      - RTP_FINISH=18100
    
     ## Use for External MySQL Server
      - DB_EMBEDDED=FALSE

     ### These are only necessary if DB_EMBEDDED=FALSE
      - DB_HOST=freepbx-db
      - DB_PORT=3306
      - DB_NAME=asterisk
      - DB_USER=asterisk
      - DB_PASS=asteriskpass
    
     ### If you are using TLS Support for Apache to listen on 443 in the container drop them in /certs and set these:
     #- TLS_CERT=cert.pem
     #- TLS_KEY=key.pem
     
    restart: always
    networks:
      - zabbix-proxy

    ### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment
    cap_add:
      - NET_ADMIN
    privileged: true

  freepbx-db:
    container_name: freepbx-db
    image: tiredofit/mariadb
    restart: always
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=asterisk
      - MYSQL_USER=asterisk
      - MYSQL_PASSWORD=asteriskpass
    networks:
      - zabbix-proxy

  freepbx-db-backup:
    container_name: freepbx-db-backup
    image: tiredofit/db-backup
    links:
     - freepbx-db
    volumes:
      - ./dbbackup:/backup
    environment:
      - ZABBIX_HOSTNAME=freepbx-db-backup
      - DB_HOST=freepbx-db
      - DB_TYPE=mariadb
      - DB_NAME=asterisk
      - DB_USER=asterisk
      - DB_PASS=asteriskpass
      - DB_DUMP_FREQ=1440
      - DB_DUMP_BEGIN=0000
      - DB_CLEANUP_TIME=8640
      - COMPRESSION=BZ
      - MD5=TRUE
    networks:
      - zabbix-proxy
    restart: always

networks:
  zabbix-proxy:
    external:
      name: zabbix-proxy


logs: freepbx-app:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] 00-functions: applying... ,
[fix-attrs.d] 00-functions: exited 0.,
[fix-attrs.d] 01-s6: applying... ,
[fix-attrs.d] 01-s6: exited 0.,
[fix-attrs.d] 02-zabbix: applying... ,
[fix-attrs.d] 02-zabbix: exited 0.,
[fix-attrs.d] 03-logrotate: applying... ,
[fix-attrs.d] 03-logrotate: exited 0.,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 00-startup: executing... ,
[cont-init.d] 00-startup: exited 0.,
[cont-init.d] 01-timezone: executing... ,
[cont-init.d] 01-timezone: exited 0.,
[cont-init.d] 02-permissions: executing... ,
[cont-init.d] 02-permissions: exited 0.,
[cont-init.d] 03-cron: executing... ,
[cont-init.d] 03-cron: exited 0.,
[cont-init.d] 03-zabbix: executing... ,
[cont-init.d] 03-zabbix: exited 0.,
[cont-init.d] 04-cron: executing... ,
[cont-init.d] 04-cron: exited 0.,
[cont-init.d] 05-fail2ban: executing... ,
[INFO] ** [fail2ban] Starting Fail2ban,
[cont-init.d] 05-fail2ban: exited 0.,
[cont-init.d] 05-smtp: executing... ,
[NOTICE] ** [smtp] Sendmail replaced and enabled to route mail to: 'postfix-relay',
[cont-init.d] 05-smtp: exited 0.,
[cont-init.d] 08-mongodb: executing... ,
[cont-init.d] 08-mongodb: exited 0.,
[cont-init.d] 09-mariadb: executing... ,
[cont-init.d] 09-mariadb: exited 0.,
[cont-init.d] 10-freepbx: executing... ,
[NOTICE] ** [freepbx] Setting File Permissions,
[NOTICE] ** [freepbx] Setting Configuration,
[NOTICE] ** [freepbx] Setting RTP Ports - Start: '18000' Finish: '18100',
ERROR 1146 (42S02) at line 1: Table 'asterisk.sipsettings' doesn't exist,
[INFO] ** [freepbx] Starting Asterisk,
[INFO] ** [freepbx] Starting Operator Panel,
[INFO] ** [freepbx] Web Server Started - Container Initialization Complete,
[cont-init.d] 10-freepbx: exited 0.,
[cont-init.d] 99-container: executing... ,
[cont-init.d] 99-container: exited 0.,
[cont-init.d] done.,
[services.d] starting services,
[services.d] done.,
[INFO] ** [zabbix] Starting Zabbix Agent,
[INFO] ** [cron] Starting cron,

freepbx-db:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] 00-functions: applying... ,
[fix-attrs.d] 00-functions: exited 0.,
[fix-attrs.d] 01-s6: applying... ,
[fix-attrs.d] 01-s6: exited 0.,
[fix-attrs.d] 02-zabbix: applying... ,
[fix-attrs.d] 02-zabbix: exited 0.,
[fix-attrs.d] 03-logrotate: applying... ,
[fix-attrs.d] 03-logrotate: exited 0.,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 00-startup: executing... ,
[cont-init.d] 00-startup: exited 0.,
[cont-init.d] 01-timezone: executing... ,
[NOTICE] ** [timezone] Setting timezone to 'America/Vancouver',
[cont-init.d] 01-timezone: exited 0.,
[cont-init.d] 02-permissions: executing... ,
[cont-init.d] 02-permissions: exited 0.,
[cont-init.d] 03-zabbix: executing... ,
[cont-init.d] 03-zabbix: exited 0.,
[cont-init.d] 04-cron: executing... ,
[NOTICE] ** [cron] Disabling Cron,
[cont-init.d] 04-cron: exited 0.,
[cont-init.d] 05-smtp: executing... ,
[NOTICE] ** [smtp] Disabling SMTP Features,
[cont-init.d] 05-smtp: exited 0.,
[cont-init.d] 10-mariadb: executing... ,
[WARN] ** [mariadb] MariaDB directory already present, skipping DB creation,
[cont-init.d] 10-mariadb: exited 0.,
[cont-init.d] 20-mariadb-backup: executing... ,
[NOTICE] ** [mariadb-backup] Disabling Scheduled Backups,
[cont-init.d] 20-mariadb-backup: exited 0.,
[cont-init.d] 99-container: executing... ,
[cont-init.d] 99-container: exited 0.,
[cont-init.d] done.,
[services.d] starting services,
[services.d] done.,
[INFO] ** [mariadb] Starting MariaDB 10.4.12,
[INFO] ** [zabbix] Starting Zabbix Agent,

zabbix_agentd.log:

  3859:20200328:115244.214 Starting Zabbix Agent [freepbx-app]. Zabbix 4.4.7 (revision 77fb8c7ee0).
  3859:20200328:115244.214 **** Enabled features ****
  3859:20200328:115244.214 IPv6 support:          YES
  3859:20200328:115244.214 TLS support:           YES
  3859:20200328:115244.214 **************************
  3859:20200328:115244.214 using configuration file: /etc/zabbix/zabbix_agentd.conf
  3859:20200328:115244.214 agent #0 started [main process]
  3889:20200328:115244.215 agent #1 started [collector]
  3890:20200328:115244.215 agent #2 started [listener #1]
  3893:20200328:115244.216 agent #5 started [active checks #1]
  3891:20200328:115244.218 agent #3 started [listener #2]
  3892:20200328:115244.218 agent #4 started [listener #3]
  3893:20200328:115244.239 active check configuration update from [zabbix-proxy:10051] started to fail (cannot resolve [zabbix-proxy])
  3859:20200328:121037.179 Got signal [signal:15(SIGTERM),sender_pid:35,sender_uid:0,reason:0]. Exiting ...
  3859:20200328:121037.263 Zabbix Agent stopped. Zabbix 4.4.7 (revision 77fb8c7ee0).
    40:20200328:121100.777 Starting Zabbix Agent [freepbx-app]. Zabbix 4.4.7 (revision 77fb8c7ee0).
    40:20200328:121100.777 **** Enabled features ****
    40:20200328:121100.777 IPv6 support:          YES
    40:20200328:121100.777 TLS support:           YES
    40:20200328:121100.777 **************************
    40:20200328:121100.777 using configuration file: /etc/zabbix/zabbix_agentd.conf
    40:20200328:121100.777 agent #0 started [main process]
   133:20200328:121100.778 agent #1 started [collector]
   135:20200328:121100.779 agent #3 started [listener #2]
   134:20200328:121100.779 agent #2 started [listener #1]
   136:20200328:121100.779 agent #4 started [listener #3]
   137:20200328:121100.781 agent #5 started [active checks #1]
   137:20200328:121100.801 active check configuration update from [zabbix-proxy:10051] started to fail (cannot resolve [zabbix-proxy])
    40:20200328:121101.225 Got signal [signal:15(SIGTERM),sender_pid:35,sender_uid:0,reason:0]. Exiting ...
    40:20200328:121101.228 Zabbix Agent stopped. Zabbix 4.4.7 (revision 77fb8c7ee0).
  2190:20200328:121121.914 Starting Zabbix Agent [freepbx-app]. Zabbix 4.4.7 (revision 77fb8c7ee0).
  2190:20200328:121121.914 **** Enabled features ****
  2190:20200328:121121.914 IPv6 support:          YES
  2190:20200328:121121.914 TLS support:           YES
  2190:20200328:121121.914 **************************
  2190:20200328:121121.914 using configuration file: /etc/zabbix/zabbix_agentd.conf
  2190:20200328:121121.914 agent #0 started [main process]
  2248:20200328:121121.916 agent #5 started [active checks #1]
  2247:20200328:121121.917 agent #4 started [listener #3]
  2246:20200328:121121.920 agent #3 started [listener #2]
  2245:20200328:121121.922 agent #2 started [listener #1]
  2244:20200328:121121.924 agent #1 started [collector]
  2248:20200328:121121.942 active check configuration update from [zabbix-proxy:10051] started to fail (cannot resolve [zabbix-proxy])
  2194:20200328:122400.859 Starting Zabbix Agent [freepbx-app]. Zabbix 4.4.7 (revision 77fb8c7ee0).
  2194:20200328:122400.859 **** Enabled features ****
  2194:20200328:122400.859 IPv6 support:          YES
  2194:20200328:122400.859 TLS support:           YES
  2194:20200328:122400.859 **************************
  2194:20200328:122400.859 using configuration file: /etc/zabbix/zabbix_agentd.conf
  2194:20200328:122400.859 agent #0 started [main process]
  2248:20200328:122400.859 agent #1 started [collector]
  2249:20200328:122400.860 agent #2 started [listener #1]
  2250:20200328:122400.862 agent #3 started [listener #2]
  2251:20200328:122400.863 agent #4 started [listener #3]
  2252:20200328:122400.863 agent #5 started [active checks #1]
  2252:20200328:122400.884 active check configuration update from [zabbix-proxy:10051] started to fail (cannot resolve [zabbix-proxy])
  2194:20200328:130547.873 Got signal [signal:15(SIGTERM),sender_pid:32,sender_uid:0,reason:0]. Exiting ...
  2194:20200328:130547.879 Zabbix Agent stopped. Zabbix 4.4.7 (revision 77fb8c7ee0).
  2194:20200328:130642.130 Starting Zabbix Agent [freepbx-app]. Zabbix 4.4.7 (revision 77fb8c7ee0).
  2194:20200328:130642.130 **** Enabled features ****
  2194:20200328:130642.130 IPv6 support:          YES
  2194:20200328:130642.130 TLS support:           YES
  2194:20200328:130642.130 **************************
  2194:20200328:130642.130 using configuration file: /etc/zabbix/zabbix_agentd.conf
  2194:20200328:130642.130 agent #0 started [main process]
  2253:20200328:130642.132 agent #5 started [active checks #1]
  2252:20200328:130642.134 agent #4 started [listener #3]
  2251:20200328:130642.136 agent #3 started [listener #2]
  2250:20200328:130642.139 agent #2 started [listener #1]
  2249:20200328:130642.143 agent #1 started [collector]
  2253:20200328:130642.166 active check configuration update from [zabbix-proxy:10051] started to fail (cannot resolve [zabbix-proxy])

zabbix_agentd.conf:

LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=1
DebugLevel=3
EnableRemoteCommands=1
LogRemoteCommands=1
Server=0.0.0.0/0
ListenPort=10050
ListenIP=0.0.0.0
StartAgents=3
ServerActive=zabbix-proxy
Hostname=freepbx-app
RefreshActiveChecks=120
BufferSend=5
BufferSize=100
MaxLinesPerSecond=20
AllowRoot=1
User=zabbix
Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf

Anzic23 avatar Mar 28 '20 20:03 Anzic23

If you aren't requiring Zabbix Monitoring services just turn it off ENABLE_ZABBIX=FALSE as per https://github.com/tiredofit/docker-debian/blob/buster/README.md

tiredofit avatar Mar 28 '20 20:03 tiredofit

I edited the file, but it didn't help, maybe I didn't edit it correctly?

version: '2'

services:
  freepbx-app:
    container_name: freepbx-app
    image: tiredofit/freepbx
    ports:
     #### If you aren't using a reverse proxy
      - 8014:80
     #### If you want SSL Support and not using a reverse proxy
     #- 443:443
      - 5060:5060/udp
      - 5160:5160/udp
      - 18000-18100:18000-18100/udp
     #### Flash Operator Panel
      - 4445:4445
    volumes:
      - ./certs:/certs
      - ./data:/data
      - ./logs:/var/log
      - ./data/www:/var/www/html
     ### Only Enable this option below if you set DB_EMBEDDED=TRUE
     #- ./db:/var/lib/mysql
     ### You can drop custom files overtop of the image if you have made modifications to modules/css/whatever - Use with care
     #- ./assets/custom:/assets/custom

    environment: 
      - VIRTUAL_HOST=freepbx.huako.ru
      - VIRTUAL_NETWORK=zabbix-proxy
     ### If you want to connect to the SSL Enabled Container 
     #- VIRTUAL_PORT=443
     #- VIRTUAL_PROTO=https
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=freepbx.huako.ru
      - [email protected]
      - ENABLE_ZABBIX=FALSE
      - RTP_START=18000
      - RTP_FINISH=18100
    
     ## Use for External MySQL Server
      - DB_EMBEDDED=FALSE

     ### These are only necessary if DB_EMBEDDED=FALSE
      - DB_HOST=freepbx-db
      - DB_PORT=3306
      - DB_NAME=asterisk
      - DB_USER=asterisk
      - DB_PASS=asteriskpass
    
     ### If you are using TLS Support for Apache to listen on 443 in the container drop them in /certs and set these:
     #- TLS_CERT=cert.pem
     #- TLS_KEY=key.pem
     
    restart: always
    networks:
      - zabbix-proxy

    ### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment
    cap_add:
      - NET_ADMIN
    privileged: true

  freepbx-db:
    container_name: freepbx-db
    image: tiredofit/mariadb
    restart: always
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=asterisk
      - MYSQL_USER=asterisk
      - MYSQL_PASSWORD=asteriskpass
    networks:
      - zabbix-proxy

  freepbx-db-backup:
    container_name: freepbx-db-backup
    image: tiredofit/db-backup
    links:
     - freepbx-db
    volumes:
      - ./dbbackup:/backup
    environment:
      #- ZABBIX_HOSTNAME=freepbx-db-backup
      - DB_HOST=freepbx-db
      - DB_TYPE=mariadb
      - DB_NAME=asterisk
      - DB_USER=asterisk
      - DB_PASS=asteriskpass
      - DB_DUMP_FREQ=1440
      - DB_DUMP_BEGIN=0000
      - DB_CLEANUP_TIME=8640
      - COMPRESSION=BZ
      - MD5=TRUE
    networks:
      - zabbix-proxy
    restart: always

networks:
  zabbix-proxy:
    external:
      name: zabbix-proxy


Anzic23 avatar Mar 28 '20 20:03 Anzic23

You are delcaring a network for zabbix-proxy twice. Try this instead for all networks per service:

    networks:
      - proxy-tier

And at the bottom of the file:

networks:
  proxy-tier:
    external:
      name: nginx-proxy

then make sure you have a docker network created for nginx-proxy. docker network create nginx-proxy

tiredofit avatar Mar 28 '20 21:03 tiredofit

I'm not sure what exactly helped, but the docker-compose.yml and deleting all data in directories helped launch the service. Also, the address should have been http:\ip:8014\admin next time I'll try to use your network hint.

version: '2'

services:
  freepbx-app:
    container_name: freepbx-app
    image: tiredofit/freepbx
    ports:
     #### If you aren't using a reverse proxy
      - 8014:80
     #### If you want SSL Support and not using a reverse proxy
     #- 443:443
      - 5060:5060/udp
      - 5160:5160/udp
      - 18000-18100:18000-18100/udp
     #### Flash Operator Panel
      - 4445:4445
    volumes:
      - ./certs:/certs
      - ./data:/data
      - ./logs:/var/log
      - ./data/www:/var/www/html
     ### Only Enable this option below if you set DB_EMBEDDED=TRUE
     #- ./db:/var/lib/mysql
     ### You can drop custom files overtop of the image if you have made modifications to modules/css/whatever - Use with care
     #- ./assets/custom:/assets/custom

    environment: 
      - VIRTUAL_HOST=freepbx.huako.ru
      - VIRTUAL_NETWORK=zabbix-proxy
     ### If you want to connect to the SSL Enabled Container 
     #- VIRTUAL_PORT=443
     #- VIRTUAL_PROTO=https
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=freepbx.huako.ru
      - [email protected]
      - ENABLE_ZABBIX=FALSE
      - RTP_START=18000
      - RTP_FINISH=18100
    
     ## Use for External MySQL Server
      - DB_EMBEDDED=FALSE

     ### These are only necessary if DB_EMBEDDED=FALSE
      - DB_HOST=freepbx-db
      - DB_PORT=3306
      - DB_NAME=asterisk
      - DB_USER=asterisk
      - DB_PASS=asteriskpass
    
     ### If you are using TLS Support for Apache to listen on 443 in the container drop them in /certs and set these:
     #- TLS_CERT=cert.pem
     #- TLS_KEY=key.pem
     
    restart: always
    networks:
      - zabbix-proxy

    ### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment
    cap_add:
      - NET_ADMIN
    privileged: true

  freepbx-db:
    container_name: freepbx-db
    image: tiredofit/mariadb
    restart: always
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=asterisk
      - MYSQL_USER=asterisk
      - MYSQL_PASSWORD=asteriskpass
      - ENABLE_ZABBIX=FALSE
    networks:
      - zabbix-proxy

  freepbx-db-backup:
    container_name: freepbx-db-backup
    image: tiredofit/db-backup
    links:
     - freepbx-db
    volumes:
      - ./dbbackup:/backup
    environment:
      #- ZABBIX_HOSTNAME=freepbx-db-backup
      - ENABLE_ZABBIX=FALSE
      - DB_HOST=freepbx-db
      - DB_TYPE=mariadb
      - DB_NAME=asterisk
      - DB_USER=asterisk
      - DB_PASS=asteriskpass
      - DB_DUMP_FREQ=1440
      - DB_DUMP_BEGIN=0000
      - DB_CLEANUP_TIME=8640
      - COMPRESSION=BZ
      - MD5=TRUE
    networks:
      - zabbix-proxy
    restart: always

networks:
  zabbix-proxy:
    external:
      name: zabbix-proxy


Anzic23 avatar Mar 28 '20 21:03 Anzic23

now i can't install module. I do not have any modules, when I try to put this window appears, what should I do with it? image

Anzic23 avatar Mar 28 '20 22:03 Anzic23

Best to start entirely fresh, delete any of your volumes including your database. Sounds like the install didn't complete.

tiredofit avatar Mar 28 '20 22:03 tiredofit