Git Product home page Git Product logo

monitoringartist / dockbix-xxl Goto Github PK

View Code? Open in Web Editor NEW
377.0 40.0 139.0 8.55 MB

:whale: Dockerized Zabbix - server, web, proxy, java gateway, snmpd with additional extensions

Home Page: https://hub.docker.com/u/monitoringartist/

License: GNU General Public License v2.0

Shell 18.96% PHP 10.83% Python 0.50% JavaScript 55.59% CSS 5.09% PLpgSQL 0.27% Dockerfile 8.76%
zabbix-docker zabbix monitoring docker

dockbix-xxl's People

Contributors

ariarijp avatar dermika avatar ethinx avatar fernandezcuesta avatar hisaharu avatar jangaraj avatar jbartko avatar kompa3 avatar netaskd avatar pozgo avatar uyorum avatar zembutsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dockbix-xxl's Issues

Zabbix server is not listening on port 10051

Hello,

When launching the container as described in the README.md, I cannot push data to Zabbix as it seems its not listening on port 10051 (inside the container). Therefore I cannot push data from agents to this server.

Tested with
. Docker 1.7.1-1.el7.centos.x86_64 on CentOS Linux release 7.1.1503 (Core)
. Docker version 1.6.2, build ba1f6c3/1.6.2`, on CentOS Linux release 7.1.1503 (Core)
. Docker version 1.7.0, build 0baf609, on Ubuntu 15.04

$ docker run -d --name zabbix -p 8080:80 -p 10051:10051 --env="DB_ADDRESS=192.168.33.10" --env="DB_USER=zabbix" --env="DB_PASS=zabbix" zabbix/zabbix-server-2.4:2.4.4
2c081abf133d1521109256a8e408d0568bb130215f697f6768dfe2acb7bc30bc

$ docker ps
CONTAINER ID        IMAGE                            COMMAND                CREATED             STATUS                PORTS                                                                NAMES
2c081abf133d        zabbix/zabbix-server-2.4:2.4.4   "/config/bootstrap.s   4 seconds ago       Up 3 seconds        443/tcp, 10052/tcp, 0.0.0.0:10051->10051/tcp, 0.0.0.0:8080->80/tcp   zabbix       

The start logs seems OK

$ docker logs zabbix
Nginx status page: allowed address set to 127.0.0.1.
PHP-FPM status page: allowed address set to 127.0.0.1.
[LOG 11:33:10] Preparing server configuration
[LOG 11:33:10] Config updated.
[LOG 11:33:10] Enabling Logging and pid management.
[LOG 11:33:10] Done
[LOG 11:33:10] Checking if Database exists or fresh install
[LOG 11:33:10] Zabbix DB Exists. Starting server.
2015-07-23 11:33:10,771 CRIT Supervisor running as root (no user in config file)
2015-07-23 11:33:10,771 WARN Included extra file "/etc/supervisor.d/zabbix.conf" during parsing
2015-07-23 11:33:10,771 WARN Included extra file "/etc/supervisor.d/php-fpm.conf" during parsing
2015-07-23 11:33:10,771 WARN Included extra file "/etc/supervisor.d/nginx.conf" during parsing
2015-07-23 11:33:10,780 INFO RPC interface 'supervisor' initialized
2015-07-23 11:33:10,781 INFO supervisord started with pid 80
2015-07-23 11:33:11,783 INFO spawned: 'nginx' with pid 88
2015-07-23 11:33:11,785 INFO spawned: 'nginx-reload' with pid 89
2015-07-23 11:33:11,786 INFO spawned: 'php-fpm' with pid 90
2015-07-23 11:33:11,788 INFO spawned: 'zabbix-server' with pid 91
2015-07-23 11:33:11,800 DEBG 'nginx' stderr output:
2015/07/23 11:33:11 [notice] 88#0: using the "epoll" event method
2015/07/23 11:33:11 [notice] 88#0: nginx/1.8.0
2015/07/23 11:33:11 [notice] 88#0: built by gcc 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) 
2015/07/23 11:33:11 [notice] 88#0: OS: Linux 3.19.0-22-generic
2015/07/23 11:33:11 [notice] 88#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2015/07/23 11:33:11 [notice] 88#0: start worker processes

2015-07-23 11:33:11,801 DEBG 'nginx' stderr output:
2015/07/23 11:33:11 [notice] 88#0: start worker process 94
2015/07/23 11:33:11 [notice] 88#0: start worker process 95

2015-07-23 11:33:11,801 DEBG 'nginx' stderr output:
2015/07/23 11:33:11 [notice] 88#0: start worker process 96

2015-07-23 11:33:11,801 DEBG 'nginx' stderr output:
2015/07/23 11:33:11 [notice] 88#0: start worker process 97

2015-07-23 11:33:11,865 DEBG fd 13 closed, stopped monitoring <POutputDispatcher at 140625428393136 for <Subprocess at 140625430825584 with name php-fpm in state STARTING> (stdout)>
2015-07-23 11:33:11,865 DEBG 'php-fpm' stderr output:
[23-Jul-2015 11:33:11] WARNING: Nothing matches the include pattern '/data/conf/php-fpm-www-*.conf' from /etc/php-fpm.d/www.conf at line 18.

2015-07-23 11:33:11,866 DEBG fd 17 closed, stopped monitoring <POutputDispatcher at 140625428392848 for <Subprocess at 140625430825584 with name php-fpm in state STARTING> (stderr)>
2015-07-23 11:33:12,867 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-07-23 11:33:12,868 INFO success: nginx-reload entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-07-23 11:33:12,868 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-07-23 11:33:12,868 INFO success: zabbix-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

When diving into the container, there is nothing listening on port 10051

$ docker exec -ti 2c081abf133d bash
[root@2c081abf133d /]# netstat -lpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      88/nginx: master pr 
tcp        0      0 0.0.0.0:9111            0.0.0.0:*               LISTEN      80/python           
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      -                   
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
unix  2      [ ACC ]     STREAM     LISTENING     27530893 90/php-fpm: master   /var/run/php-fpm-www.sock

However, all required processes seems to be here, especially zabbix_server

[root@2c081abf133d /]# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 11:33 ?        00:00:00 /bin/bash /config/bootstrap.sh
zabbix      79     1  0 11:33 ?        00:00:00 zabbix_agentd -c /usr/local/etc/zabbix_agentd.conf
root        80     1  0 11:33 ?        00:00:00 /usr/bin/python /usr/bin/supervisord -n -c /etc/supervisord.conf
zabbix      81    79  0 11:33 ?        00:00:00 zabbix_agentd: collector [idle 1 sec]
zabbix      82    79  0 11:33 ?        00:00:00 zabbix_agentd: listener #1 [waiting for connection]
zabbix      83    79  0 11:33 ?        00:00:00 zabbix_agentd: listener #2 [waiting for connection]
zabbix      84    79  0 11:33 ?        00:00:00 zabbix_agentd: listener #3 [waiting for connection]
zabbix      85    79  0 11:33 ?        00:00:00 zabbix_agentd: active checks #1 [idle 1 sec]
root        88    80  0 11:33 ?        00:00:00 nginx: master process /usr/sbin/nginx
root        89    80  0 11:33 ?        00:00:00 bash -c while inotifywait -q -r -e create,delete,modify,move,attrib --exclude "/\." /etc/nginx/ /data/conf/nginx/; do nginx -t && nginx -s reload; done
root        90    80  0 11:33 ?        00:00:00 php-fpm: master process (/etc/php-fpm.conf)
root        91    80  0 11:33 ?        00:00:00 /bin/sh /config/ds.sh /var/run/zabbix_server.pid zabbix_server -c /usr/local/etc/zabbix_server.conf
root        92    89  0 11:33 ?        00:00:00 inotifywait -q -r -e create,delete,modify,move,attrib --exclude /\. /etc/nginx/ /data/conf/nginx/
www         94    88  0 11:33 ?        00:00:00 nginx: worker process
www         95    88  0 11:33 ?        00:00:00 nginx: worker process
www         96    88  0 11:33 ?        00:00:00 nginx: worker process
www         97    88  0 11:33 ?        00:00:00 nginx: worker process
zabbix      99     1  0 11:33 ?        00:00:00 zabbix_server -c /usr/local/etc/zabbix_server.conf
root       542     0  0 11:35 ?        00:00:00 bash
root      1194    91  0 11:37 ?        00:00:00 sleep 0.5
root      1195   542  0 11:37 ?        00:00:00 ps -ef

Server conf is the default one

[root@2c081abf133d /]# sed -e '/^#/d' -e '/^$/d' /usr/local/etc/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
DebugLevel=0
PidFile=/var/run/zabbix_server.pid
DBHost=zabbix.db
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
StartPollers=1
StartIPMIPollers=1
StartTrappers=1
JavaGateway=127.0.0.1
StartJavaPollers=1
StartVMwareCollectors=1
VMwareFrequency=10
VMwareCacheSize=256K
SNMPTrapperFile=/var/log/snmptt/snmptt.log
SenderFrequency=10
CacheUpdateFrequency=10
StartDBSyncers=1
HistoryCacheSize=8M
TrendCacheSize=4M
HistoryTextCacheSize=16M
ValueCacheSize=8M
Timeout=30
UnreachablePeriod=10
UnavailableDelay=10
UnreachableDelay=10

Zabbix server logs says nothing about not being able to listen on port 10051

[root@2c081abf133d /]# cat /var/log/zabbix/zabbix_server.log 
    99:20150723:113311.808 Starting Zabbix Server. Zabbix 2.4.4 (revision {ZABBIX_REVISION}).
    99:20150723:113311.808 ****** Enabled features ******
    99:20150723:113311.808 SNMP monitoring:           YES
    99:20150723:113311.808 IPMI monitoring:           YES
    99:20150723:113311.808 WEB monitoring:            YES
    99:20150723:113311.808 VMware monitoring:         YES
    99:20150723:113311.808 Jabber notifications:       NO
    99:20150723:113311.809 Ez Texting notifications:  YES
    99:20150723:113311.809 ODBC:                       NO
    99:20150723:113311.809 SSH2 support:               NO
    99:20150723:113311.809 IPv6 support:               NO
    99:20150723:113311.809 ******************************
    99:20150723:113311.809 using configuration file: /usr/local/etc/zabbix_server.conf

I hope I'm using this image correctly. Let me know if you need more info.
Thanks in advance for your help!

default env $JAVA didn't work

Default environment JAVA is not work....

[root@zabbix-server /]# /usr/local/sbin/zabbix_java/startup.sh
/usr/local/sbin/zabbix_java/startup.sh: line 62: /usr/lib/jvm/java-1.8.0-openjdk/bin/java: No such file or directory
Zabbix Java Gateway did not start

[root@zabbix-server /]# export JAVA=/usr/bin/java
[root@zabbix-server /]# 
[root@zabbix-server /]# 
[root@zabbix-server /]# /usr/local/sbin/zabbix_java/startup.sh
[root@zabbix-server /]# 

[root@zabbix-server /]#

Startup issue with zabbix/zabbix-server-2.4

Hi all, I'm having a problem with the startup of zabbix/zabbix-server-2.4.

Im getting the following error:

765cfe213f9e2c217bc05b0da1766c68dac506799aa94c12d693cf01ee426b50
root@ks1:~/containers/zabbix# docker logs -f 765cfe213f9e2c217bc05b0da1766c68dac506799aa94c12d693cf01ee426b50
Nginx status page: allowed address set to 127.0.0.1.
PHP-FPM status page: allowed address set to 127.0.0.1.
[LOG 11:44:17] Preparing server configuration
[LOG 11:44:17] Config updated.
[LOG 11:44:17] Enabling logging and pid management
/config/init/bootstrap.sh: line 50: which: command not found
chmod: missing operand after 'u+s'
Try 'chmod --help' for more information.

Any ideas? Looks like we might need to install which inside the container?

Database not upgraded

Upgraded my image today to latest (3.0.4) and got this issue:

2016-10-24 13:48:31,621 DEBG 'zabbix-server' stdout output:
  1781:20161024:134831.620 The server does not match Zabbix database. Current database version (mandatory/optional): 03020000/03020000. Required mandatory version: 03000000.

That's unfortunate because I'm pretty sure that I already saw Zabbix XXL automagically upgrade the database once.
I can't be sure of that last version I used, but that was a 3.0.x image.
How can i get out of this issue without wiping my db ?

fail to connect mariadb container

here my command:
1.
[root@docker ~]# docker run -d --name zabbixdb -v /backups:/backups -v /etc/localtime:/etc/localtime:ro --volumes-from zabbix-db-storage --env="MARIADB_USER=zabbix" --env="MARIADB_PASS=zabbix" monitoringartist/zabbix-db-mariadb
2.
[root@docker ~]# docker run -d --name zabbix -p 80:80 -p 10051:10051 -p 10052:10052 -v /etc/localtime:/etc/localtime:ro --link zabbixdb:zabbixdb --env="ZS_DBHost=zabbixdb" --env="ZS_DBUser=zabbix" --env="ZS_DBPassword=zabbix" monitoringartist/zabbix-3.0-xxl:latest
3. in zabbix container, monitor zabbix_server.log file. show....
[root@3cf17a594e19 /]# tail -f /tmp/zabbix_server.log
6415:20160621:010857.554 using configuration file: /usr/local/etc/zabbix_server.conf
6415:20160621:010857.616 [Z3001] connection to database 'zabbix' failed: [2005] Unknown MySQL server host 'zabbixdb' (111)
6415:20160621:010857.620 Cannot connect to the database. Exiting...
6423:20160621:010900.779 Starting Zabbix Server. Zabbix 3.0.3 (2016-06-19) (revision {ZABBIX_REVISION}).
6423:20160621:010900.779 ****** Enabled features ******
6423:20160621:010900.779 SNMP monitoring: YES
6423:20160621:010900.779 IPMI monitoring: YES
6423:20160621:010900.779 Web monitoring: YES
6423:20160621:010900.779 VMware monitoring: YES
6423:20160621:010900.779 SMTP authentication: YES
6423:20160621:010900.779 Jabber notifications: YES
6423:20160621:010900.779 Ez Texting notifications: YES
6423:20160621:010900.780 ODBC: YES
6423:20160621:010900.780 SSH2 support: YES
6423:20160621:010900.780 IPv6 support: YES
6423:20160621:010900.780 TLS support: YES
6423:20160621:010900.780 ******************************
6423:20160621:010900.780 using configuration file: /usr/local/etc/zabbix_server.conf
6423:20160621:010900.850 [Z3001] connection to database 'zabbix' failed: [2005] Unknown MySQL server host 'zabbixdb' (111)

6423:20160621:010900.854 Cannot connect to the database. Exiting...

4. but in zabbix container, i can connect to the zabbixdb container. what's wrong?
[root@3cf17a594e19 /]# mysql -u zabbix -p -h zabbixdb
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 19
Server version: 10.0.25-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [zabbix]> create table testtab(id int,name varchar(20));
Query OK, 0 rows affected (0.05 sec)

MariaDB [zabbix]> insert into testtab values(1,'dd');
Query OK, 1 row affected (0.00 sec)

5. webui http://ip:80, has error with this.
Database error
Error connecting to database: php_network_getaddresses: getaddrinfo failed: Name or service not known

Can the image run as proxy?

Because run Zabbix on distributed environment usually will use proxy, but don't know can this image run as proxy, or will have another image for proxy.

Should enable include directories for easier customization

The default zabbix config file keeps the Include directive commented out. Uncommenting it to allow /usr/local/etc/zabbix_server.conf.d/*conf file would help users customize the setup. Also, if you can enable the Java Gateway, you should have StartJavaPollers to a non-zero value by default

Dockerfile on Docker Hub is different from the one in the GitHub repo for 2.4.6

The Dockerfile on the Zabbix Docker registry is different from the one in the repo for 2.4.6:

Docker Hub: https://hub.docker.com/r/zabbix/zabbix-server-2.4/~/dockerfile/

FROM million12/nginx-php
MAINTAINER Przemyslaw Ozgo [email protected]

ENV ZABBIX_VERSION=2.4.6

ADD foreground.patch /

RUN \
  yum clean all && yum makecache && \
  yum update --nogpgcheck -y && \
  yum install --nogpgcheck -y svn gcc automake make nmap traceroute iptstate wget sudo net-snmp-devel net-snmp-libs net-snmp net-snmp-perl net-snmp-python net-snmp-utils php-snmp php-ldap java-1.8.0-openjdk java-1.8.0-openjdk-devel mariadb-devel libxml2-devel libcurl-devel OpenIPMI-devel && \
  svn co svn://svn.zabbix.com/tags/${ZABBIX_VERSION} /usr/local/src/zabbix && \
  cd /usr/local/src/zabbix && \
  svn patch /foreground.patch && \
  ./bootstrap.sh && \
  ./configure --enable-server --enable-agent --with-mysql --enable-java --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi && \
  make dbschema && \
  make install && \
  rpm -e --nodeps make gcc && \
  yum remove -y svn automake mariadb-devel java-1.8.0-openjdk-devel libxml2-devel libcurl-devel OpenIPMI-devel && \
  yum clean all

ENV \
  JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk/bin/java \
  JAVA=/usr/lib/jvm/java-1.8.0-openjdk/bin/java \
  DB_ADDRESS=127.0.0.1 DB_USER=admin DB_PASS=password

COPY container-files /


EXPOSE 10051 10052 80

GitHub repo: https://github.com/zabbix/zabbix-community-docker/blob/master/Dockerfile/zabbix-server-2.4/Dockerfile

FROM centos:centos7
MAINTAINER Jan Garaj [email protected]

# ZABBIX_VERSION= trunk tags/2.4.6 branches/dev/ZBXNEXT-1263-1

ENV \
  ZABBIX_VERSION=tags/2.4.6 \
  STATUS_PAGE_ALLOWED_IP=127.0.0.1 \
  JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk/bin/java \
  JAVA=/usr/lib/jvm/java-1.8.0-openjdk/bin/java \
  PHP_date_timezone=UTC \
  PHP_max_execution_time=300 \
  PHP_max_input_time=300 \
  PHP_memory_limit=128M \
  PHP_error_reporting=E_ALL \
  ZS_ListenPort=10051 \
  ZS_SourceIP="" \
  ZS_LogFile=/tmp/zabbix_server.log \
  ZS_LogFileSize=10 \
  ZS_DebugLevel=3 \
  ZS_PidFile=/var/run/zabbix_server.pid \
  ZS_DBHost=zabbix.db \
  ZS_DBName=zabbix \
  ZS_DBSchema="" \
  ZS_DBUser=zabbix \
  ZS_DBPassword=zabbix \
  ZS_DBSocket=/tmp/mysql.sock \
  ZS_DBPort=3306 \
  ZS_StartPollers=5 \
  ZS_StartPollersUnreachable=1 \
  ZS_StartTrappers=5 \
  ZS_StartPingers=1 \
  ZS_StartDiscoverers=1 \
  ZS_StartHTTPPollers=1 \
  ZS_StartTimers=1 \
  ZS_JavaGateway=127.0.0.1 \
  ZS_JavaGatewayPort=10052 \
  ZS_StartJavaPollers=0 \
  ZS_StartVMwareCollectors=0 \
  ZS_VMwareFrequency=60 \
  ZS_VMwarePerfFrequency=60 \
  ZS_VMwareCacheSize=8M \
  ZS_VMwareTimeout=10 \
  ZS_SNMPTrapperFile=/tmp/zabbix_traps.tmp \
  ZS_StartSNMPTrapper=0 \
  ZS_ListenIP=0.0.0.0 \
  ZS_HousekeepingFrequency=1 \
  ZS_MaxHousekeeperDelete=500 \
  ZS_SenderFrequency=30 \
  ZS_CacheSize=8M \
  ZS_CacheUpdateFrequency=60 \
  ZS_StartDBSyncers=4 \
  ZS_HistoryCacheSize=8M \
  ZS_TrendCacheSize=4M \
  ZS_HistoryTextCacheSize=16M \
  ZS_ValueCacheSize=8M \
  ZS_Timeout=3 \
  ZS_TrapperTimeout=300 \
  ZS_UnreachablePeriod=45 \
  ZS_UnavailableDelay=60 \
  ZS_UnreachableDelay=15 \
  ZS_AlertScriptsPath=/usr/local/share/zabbix/alertscripts \
  ZS_ExternalScripts=/usr/local/share/zabbix/externalscripts \
  ZS_FpingLocation=/usr/sbin/fping \
  ZS_Fping6Location=/usr/sbin/fping6 \
  ZS_SSHKeyLocation="" \
  ZS_LogSlowQueries=0 \
  ZS_TmpDir=/tmp \
  ZS_StartProxyPollers=1 \
  ZS_ProxyConfigFrequency=3600 \
  ZS_ProxyDataFrequency=1 \
  ZS_AllowRoot=0 \
  ZS_User=zabbix \
  ZS_Include="" \
  ZS_SSLCertLocation=/usr/local/share/zabbix/ssl/certs \
  ZS_SSLKeyLocation=/usr/local/share/zabbix/ssl/keys \
  ZS_SSLCALocation="" \
  ZS_LoadModulePath=/usr/lib/zabbix/modules \
  ZS_LoadModule="" \
  TERM=xterm

# Layer: base
RUN \
  yum clean all && \
  yum update -y && \
  yum install -y epel-release && \
  sed -i -e "\|^https://\"http://|d" /etc/yum.repos.d/epel.repo && \
  yum clean all && \
  yum install -y supervisor && \
  yum install -y http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm && \
  yum install -y nginx inotify-tools && \
  `# Rename nginx:nginx user/group to www:www, also set uid:gid to 80:80 (just to make it nice)` \
  groupmod --gid 80 --new-name www nginx && \
  usermod --uid 80 --home /data/www --gid 80 --login www --shell /bin/bash --comment www nginx && \
  `# Clean-up /etc/nginx/ directory from all not needed stuff...` \
  rm -rf /etc/nginx/*.d /etc/nginx/*_params && \
  `# Prepare dummy SSL certificates` \
  mkdir -p /etc/nginx/ssl && \
  openssl genrsa -out /etc/nginx/ssl/dummy.key 2048 && \
  openssl req -new -key /etc/nginx/ssl/dummy.key -out /etc/nginx/ssl/dummy.csr -subj "/C=GB/L=London/O=Company Ltd/CN=zabbix-docker" && \
  openssl x509 -req -days 3650 -in /etc/nginx/ssl/dummy.csr -signkey /etc/nginx/ssl/dummy.key -out /etc/nginx/ssl/dummy.crt && \
  yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && \
  yum install -y --enablerepo=remi-php56 php-fpm \
       php-gd php-bcmath php-ctype php-xml php-xmlreader php-xmlwriter \
       php-session php-net-socket php-mbstring php-gettext php-cli \
       php-mysqlnd php-opcache php-pdo php-snmp php-ldap && \
  yum clean all && rm -rf /tmp/*
ADD container-files-base /

# Layer: zabbix
COPY container-files-zabbix /
RUN \
  yum clean all && \
  yum update -y && \
  yum install -y tar svn gcc automake make nmap traceroute iptstate wget \
              net-snmp-devel net-snmp-libs net-snmp net-snmp-perl iksemel \
              net-snmp-python net-snmp-utils java-1.8.0-openjdk python-pip \
              java-1.8.0-openjdk-devel mariadb-devel libxml2-devel gettext \
              libcurl-devel OpenIPMI-devel mysql iksemel-devel libssh2-devel \
              unixODBC unixODBC-devel mysql-connector-odbc postgresql-odbc \
              openldap-devel net-tools snmptt sudo && \
 `# reinstall glibc for locales` \
  yum -y -q reinstall glibc-common && \
  cp /usr/local/etc/zabbix_agend.conf /tmp && \
  svn co svn://svn.zabbix.com/${ZABBIX_VERSION} /usr/local/src/zabbix && \
  cd /usr/local/src/zabbix && \
  DATE=`date +%Y-%m-%d` && \
  sed -i "s/ZABBIX_VERSION.*'\(.*\)'/ZABBIX_VERSION', '\1 ($DATE)'/g" frontends/php/include/defines.inc.php && \
  sed -i "s/ZABBIX_VERSION_RC.*\"\(.*\)\"/ZABBIX_VERSION_RC \"\1 (${DATE})\"/g" include/version.h && \
  sed -i "s/String VERSION =.*\"\(.*\)\"/String VERSION = \"\1 (${DATE})\"/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
  ./bootstrap.sh && \
  ./configure --enable-server --enable-agent --with-mysql --enable-java \
              --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi \
              --enable-ipv6 --with-jabber --with-openssl --with-ssh2 \
              --with-ldap  --with-unixodbc && \
  make dbschema && \
  make install && \
  cp /usr/local/etc/web/zabbix.conf.php /usr/local/src/zabbix/frontends/php/conf/ && \
  pip install py-zabbix && \
  wget https://github.com/schweikert/fping/archive/3.10.tar.gz && \
  tar -xvf 3.10.tar.gz && \
  cd fping-3.10/ && \
  ./autogen.sh && \
  ./configure --prefix=/usr/local --enable-ipv6 --enable-ipv4 && \
  make && \
  make install && \
  setcap cap_net_raw+ep /usr/local/sbin/fping && \
  setcap cap_net_raw+ep /usr/local/sbin/fping6 && \
  cd .. && \
  cp -f /tmp/zabbix_agend.conf /usr/local/etc/ && \
  rm -rf fping-3.10 && \
  rm -rf 3.10.tar.gz && \
  cd /usr/local/src/zabbix/frontends/php && \
  locale/make_mo.sh && \
  yum autoremove -y gettext python-pip tar svn gcc automake mariadb-devel \
                    java-1.8.0-openjdk-devel libxml2-devel libcurl-devel \
                    OpenIPMI-devel iksemel-devel && \
  yum install -y OpenIPMI-libs && \
  chmod +x /config/bootstrap.sh && \
  chmod +x /config/ds.sh && \
  yum clean all && \
  mkdir -p /usr/local/share/ssl/certs && \
  mkdir -p /usr/local/share/ssl/keys && \
  mkdir -p /usr/lib/zabbix/modules && \
  rm -rf /tmp/*

CMD ["/config/bootstrap.sh"]

VOLUME ["/etc/custom-config/", "/usr/local/share/zabbix/externalscripts", "/usr/local/share/zabbix/ssl/certs", "/usr/local/share/zabbix/ssl/keys", "/usr/lib/zabbix/modules"]

EXPOSE 10051 10052 80

Correct alertscript permissions

Hi, I was using 2.4 image and now migrating to 3.0, but the RUN CHMOD in my Dockerfile is not working.

In the dir "container-files" there's a usr/local/share/zabbix/alertscripts/telegram-ncat.sh

Here's the Dockerfile

ADD container-files /

RUN \
    chmod +x /usr/local/share/zabbix/alertscripts/telegram-ncat.sh

How to restore

Hi. Thank you for sharing your great project.

I lost our zabbix settings. I have the following backup files but I don't know how to restore with them.

root@sv:/# cd /backups/
root@sv:/backups# ll
-rw-r--r--  1 root root 1.1M 2016-05-31 13:49:13 zabbix_cfg_localhost_20160531-1349_db-3.0.0.sql.gz
-rw-r--r--  1 root root 8.1M 2016-05-31 13:49:16 zabbix_db_dump_2016-05-31-13.49.13.sql.bz2

Does anyone tell me that?

Segmentation fault when using storage driver 'overlay' for dockerd

docker daemon running options:
/usr/bin/dockerd -H fd:// --storage-driver=overlay --dns 172.17.0.1 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

this error could get reproduced

starting container

docker run -d --name zabbix2 -p 80:8181 -p 10051:10051 -v /etc/localtime:/etc/localtime:ro monitoringartist/zabbix-3.0-xxl:latest

container logs

docker logs zabbix2
Nginx status page: allowed address set to 127.0.0.1.
PHP-FPM status page: allowed address set to 127.0.0.1.
[LOG 16:54:50] Preparing XXL features
[LOG 16:54:50] XXL configuration done.
[LOG 16:54:50] Preparing server configuration
[LOG 16:54:50] Waiting for API, it's still not available
[LOG 16:54:50] Config updated.
[LOG 16:54:50] Enabling logging and pid management
/config/init/bootstrap.sh: line 53: 307 Segmentation fault chown root:$ZS_User /usr/sbin/fping

informations of docker and OS

docker info
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 1
Server Version: 1.12.1
Storage Driver: overlay
Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-36-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 770.4 MiB
Name: ubuntu16-docker
ID: QSST:URMA:LYAB:QE26:4DVO:K4MC:ZDFA:NC2M:BDNV:MSMD:KFEN:7NQ2
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
127.0.0.0/8

Fping request

Please add fping to main zabbix images

This can be easily done by custom Dockerfile, but i suppose, that this is general use feature

cat << EOT | tee Dockerfile

FROM zabbix/zabbix-server-2.4:latest

RUN yum -y install fping
COPY container-files /

EOT

mkdir -p container-files/config/init/
more container-files/config/init/zz-fping-permissions.sh

#!/bin/sh
set -eu
export TERM=xterm
# Bash Colors
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
white=`tput setaf 7`
bold=`tput bold`
reset=`tput sgr0`
separator=$(echo && printf '=%.0s' {1..100} && echo)
# Logging Finctions
log() {
  if [[ "$@" ]]; then echo "${bold}${green}[LOG `date +'%T'`]${reset} $@";
  else echo; fi
}
warning() {
  echo "${bold}${yellow}[WARNING `date +'%T'`]${reset} ${yellow}$@${reset}";
}
error() {
  echo "${bold}${red}[ERROR `date +'%T'`]${reset} ${red}$@${reset}";
}

log "Fix fping permissions"
chown root:zabbix /usr/sbin/fping && \
chmod 710 /usr/sbin/fping && \
chmod ug+s /usr/sbin/fping
log "Done

or add to init/bootstrap.sh into
fix_permissions() {

ICMP Ping checks fail

fping failed: sh: /usr/sbin/fping6: Device not a stream

I get this error message when I try to use a ICMP Ping check for a IPv4 Host. Running the fping command with docker exec works.

Failing to Start

docker run -it --name zabbix -p 480:80 -p 10051:10051 -v /etc/localtime:/etc/localtime:ro --link zabbix-db:zabbix.db --env="ZS_DBHost=zabbix.db" --env="ZS_DBUser=zabbix" --env="ZS_DBPassword=" monitoringartist/zabbix-3.0-xxl:latest /bin/bash

[root@7bd261ab8470 /]# /config/bootstrap.sh
Nginx status page: allowed address set to 127.0.0.1.
PHP-FPM status page: allowed address set to 127.0.0.1.
[LOG 14:03:23] Preparing XXL features
rm: cannot remove ‘/usr/local/src/zabbix/frontends/php/zapix/assets’: Directory not empty
rm: cannot remove ‘/usr/local/src/zabbix/frontends/php/zapix/css/bootstrap’: Directory not empty
rm: cannot remove ‘/usr/local/src/zabbix/frontends/php/zapix/css/img’: Directory not empty
rm: cannot remove ‘/usr/local/src/zabbix/frontends/php/zapix/js’: Directory not empty

[root@7bd261ab8470 assets]# ls -l
ls: cannot access favicon.ico: No such file or directory
ls: cannot access favicon.png: No such file or directory
total 0
?????????? ? ? ? ? ? favicon.ico
?????????? ? ? ? ? ? favicon.png

Add localtime

I think docker-compose.yml and documentation should contain an instruction to synchronize timezone from the host with docker.
For docker-compose :
zabbix:
(other stuff ...)
volumes:
- /etc/localtime:/etc/localtime:ro

and for starting zabbix with docker
run -v /etc/localtime:/etc/localtime:ro and other required parameters.

Waiting for DB service

Hello,

i have configured zabbix in docker by instructions in readme. But after first restart of machine i'm unable to start zabbix-db :/

5/19/2016 7:11:43 PMStill waiting for DB service...
5/19/2016 7:11:44 PMcat: /var/lib/mysql/mysql.pid: No such file or directory
5/19/2016 7:11:44 PMCaught SIGTERM signal, shutting down DB...
5/19/2016 7:11:44 PMkill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
5/19/2016 7:11:44 PM160519 17:10:19 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended
5/19/2016 7:11:53 PMStill waiting for DB service...
5/19/2016 7:14:51 PM=> Using an existing volume of MariaDB.
5/19/2016 7:14:51 PM----------------- Previous error log -----------------
5/19/2016 7:14:51 PM160519 17:10:19 [Note] /usr/sbin/mysqld (mysqld 10.0.25-MariaDB) starting as process 253 ...
5/19/2016 7:14:51 PM160519 17:10:19 [Warning] Could not increase number of max_open_files to more than 4096 (request: 4407)
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: Using mutexes to ref count buffer pool pages
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: The InnoDB memory heap is disabled
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: Memory barrier is not used
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: Compressed tables use zlib 1.2.7
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: Using Linux native AIO
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: Using CPU crc32 instructions
5/19/2016 7:14:51 PM160519 17:10:19 [Note] InnoDB: Initializing buffer pool, size = 768.0M
5/19/2016 7:14:51 PMInnoDB: mmap(824180736 bytes) failed; errno 12
5/19/2016 7:14:51 PM160519 17:10:19 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
5/19/2016 7:14:51 PM160519 17:10:19 [ERROR] Plugin 'InnoDB' init function returned error.
5/19/2016 7:14:51 PM160519 17:10:19 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
5/19/2016 7:14:51 PM160519 17:10:19 [ERROR] Failed to initialize plugins.
5/19/2016 7:14:51 PM160519 17:10:19 [ERROR] Aborting
5/19/2016 7:14:51 PM
5/19/2016 7:14:51 PM160519 17:10:19 [Note] /usr/sbin/mysqld: Shutdown complete
5/19/2016 7:14:51 PM
5/19/2016 7:14:51 PM160519 17:10:19 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended
5/19/2016 7:14:51 PM----------------- Previous error log ends -----------------
5/19/2016 7:14:51 PM
5/19/2016 7:14:51 PMWaiting for DB service...
5/19/2016 7:14:51 PMStill waiting for DB service...
5/19/2016 7:14:51 PM160519 17:14:51 mysqld_safe Logging to '/var/lib/mysql/error.log'.
5/19/2016 7:14:51 PM160519 17:14:51 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
5/19/2016 7:14:51 PM160519 17:14:51 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
5/19/2016 7:14:51 PM160519 17:14:51 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set
5/19/2016 7:14:51 PM160519 17:14:51 [Note] /usr/sbin/mysqld (mysqld 10.0.25-MariaDB) starting as process 252 ...
5/19/2016 7:14:51 PM160519 17:14:51 [Warning] Could not increase number of max_open_files to more than 4096 (request: 4407)
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: Using mutexes to ref count buffer pool pages
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: The InnoDB memory heap is disabled
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: Memory barrier is not used
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: Compressed tables use zlib 1.2.7
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: Using Linux native AIO
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: Using CPU crc32 instructions
5/19/2016 7:14:51 PM160519 17:14:51 [Note] InnoDB: Initializing buffer pool, size = 768.0M
5/19/2016 7:14:51 PMInnoDB: mmap(824180736 bytes) failed; errno 12
5/19/2016 7:14:51 PM160519 17:14:51 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
5/19/2016 7:14:51 PM160519 17:14:51 [ERROR] Plugin 'InnoDB' init function returned error.
5/19/2016 7:14:51 PM160519 17:14:51 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
5/19/2016 7:14:51 PM160519 17:14:51 [ERROR] Failed to initialize plugins.
5/19/2016 7:14:51 PM160519 17:14:51 [ERROR] Aborting
5/19/2016 7:14:51 PM
5/19/2016 7:14:51 PM160519 17:14:51 [Note] /usr/sbin/mysqld: Shutdown complete
5/19/2016 7:14:51 PM
5/19/2016 7:14:52 PM160519 17:14:52 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended
5/19/2016 7:14:52 PM160519 17:14:52 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended
5/19/2016 7:14:52 PMStill waiting for DB service...```

ZA config issue

then I add some like ZA_Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf and first start of container looks fine. then I restart container zabbix agent did not start. open zabbix_agentd.conf and see this:

### Option: TLSPSKFile
#       Full pathname of a file containing the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKFile=
Hostname=Zabbix server

Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
Hostname=Zabbix server
Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
Hostname=Zabbix server

userparameters of ZA is duplicated by that config

docker: Error response from daemon: Cannot link to a non running container: /zabbix-db AS /zabbix/zabbix.db.

Hello!
I am trying to install zabbix docker.

When I run this
docker run
-d
--name zabbix
-p 80:80
-p 10051:10051
-v /etc/localtime:/etc/localtime:ro
--link zabbix-db:zabbix.db
--env="ZS_DBHost=zabbix.db"
--env="ZS_DBUser=zabbix"
--env="ZS_DBPassword=my_password"
monitoringartist/zabbix-3.0-xxl:latest

I've got error
ocker: Error response from daemon: Cannot link to a non running container: /zabbix-db AS /zabbix/zabbix.db.

Here my containers
sudo docker ps -a
sudo: unable to resolve host ip-172-30-0-172
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7021ac6c4774 monitoringartist/zabbix-3.0-xxl:latest "/config/bootstrap.sh" 3 minutes ago Created zabbix
df5071136d72 monitoringartist/zabbix-db-mariadb "/run.sh" 3 minutes ago Exited (1) 3 minutes ago zabbix-db
229ca6830d94 busybox:latest "sh" 3 minutes ago Exited (0) 3 minutes ago zabbix-db-storage

I am doing exactly what manual says.
Where is my problem?

I am trying to do on my test Amazon instance.

Zabbix server and web cannot start correctly

Hi,
I just using this Docker file and see if we run the configuration not correctly in DB password when we passing it to paramater.

Issued command :

docker run -d --name zabbix -p 80:80 -p 10051:10051 \
-v /etc/localtime:/etc/localtime:ro \
--link zabbix-db:zabbix.db --env="ZS_DBHost=zabbix.db" \
--env="ZS_DBUser=zabbix" \
--env="ZS_DBPassword=P@ssword123!" \
monitoringartist/zabbix-3.0-xxl:latest

The password will be fill to ''P@ssword123!'' in #1 and 'P@ssword123!' for #2. Its incorrect. Please fix it to 'P@ssword123!' for #1 and P@ssword123! for #2
Check file #1: /usr/local/src/zabbix/frontends/php/conf/zabbix.conf.php
Check file #2: /usr/local/etc/zabbix_server.conf (DBPassword)

Thanks

Problems in docker

Run:
docker run -d --name zabbix -p 8080:80 -p 10061:10051 -v /etc/localtime:/etc/localtime:ro --env="ZS_DBHost=_" --env="ZS_DBUser=zabbix" --env="ZS_DBPassword=_" monitoringartist/zabbix-3.0-xxl:latest
Get:

  1. nginx and php-fpm don't start automatically. I wonder they should be added to bootstrap.sh.
  2. If you want to get statistics from google-analytics then consider to launch curl as daemon (with & at the end of commands), because there could be no Internet connection (curl just hangs in this/my case)

stop/start of container - group 'zabbix' already exists”

I have a problem when i try to restart container with “docker start” after “docker stop”. I get this message : “[LOG 13:08:58] Enabling Logging and pid management. groupadd: group 'zabbix' already exists” Can you help me?
Have the same problem with groupadd on Synology Docker. Probably need to add check existing user “zabbix” to bootstrap.sh:43 (fix_permissions procedure)

Zabbix group/user existence check will be useful.

zabbix db user sets to admin

Hi,

I've set the environment variables in zabbix server for the username and password:
ZS_DBUser=zabbix
ZS_DBPassword=password
however the zabbix server config file still has them as admin and password

Cannot turn off analytics

I am unable to turn off the analytics via the environment variable, XXL_analytics=false. The container fails with the log

$ sudo docker logs -f zabbix-server
Nginx status page: allowed address set to 127.0.0.1.
PHP-FPM status page: allowed address set to 127.0.0.1.
[LOG 20:35:07] Preparing XXL features
sed: -e expression #1, char 273: unknown command: `/'

I'm also really not sure, why they are turned on by default. This should be made way more prominent, if not turned off or removed entirely.

Can the compose.yml run net: host mode ?

I doubt my performance issue is the network mode of docker, when I changed bridge to be host, I met this output...

issue

it seems to be the SQL don't support a lcoal user ?

Zabbix database doesn't exist. Installing and importing default settings

I try running zabbix container. It does successfully. But after restart container all of the data disappeared

There is part of the log:

zabbix-db_1         | 160202 16:09:56 [Note] /usr/sbin/mysqld: ready for connections.
zabbix-db_1         | Version: '10.0.23-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
zabbix-db_1         | 160202 16:09:56 [Note] /usr/sbin/mysqld: ready for connections.
zabbix-db_1         | Securing and tidying DB...
zabbix-db_1         | Securing and tidying DB... Done!
zabbix-db_1         | Showing DB status...
zabbix-db_1         |
zabbix-db_1         | --------------
zabbix-db_1         | mysql  Ver 15.1 Distrib 10.0.23-MariaDB, for Linux (x86_64) using readline 5.1
zabbix-db_1         |
zabbix-db_1         | Connection id:        6
zabbix-db_1         | Current database:
zabbix-db_1         | Current user:     [email protected]
zabbix-db_1         | SSL:          Not in use
zabbix-db_1         | Current pager:        stdout
zabbix-db_1         | Using outfile:        ''
zabbix-db_1         | Using delimiter:  ;
zabbix-db_1         | Server:           MariaDB
zabbix-db_1         | Server version:       10.0.23-MariaDB MariaDB Server
zabbix-db_1         | Protocol version: 10
zabbix-db_1         | Connection:       localhost via TCP/IP
zabbix-db_1         | Server characterset:  utf8
zabbix-db_1         | Db     characterset:  utf8
zabbix-db_1         | Client characterset:  utf8
zabbix-db_1         | Conn.  characterset:  utf8
zabbix-db_1         | TCP port:     3306
zabbix-db_1         | Uptime:           1 sec
zabbix-db_1         |
zabbix-db_1         | Threads: 1  Questions: 16  Slow queries: 1  Opens: 1  Flush tables: 1  Open tables: 64  Queries per second avg: 16.000
zabbix-db_1         | --------------
zabbix-db_1         |
zabbix-db_1         | Creating DB admin user...
zabbix-db_1         |
zabbix-db_1         | => Creating MariaDB user 'zabbix' with 'my_password' password.
zabbix-db_1         | ========================================================================
zabbix-db_1         |     You can now connect to this MariaDB Server using:
zabbix-db_1         |     mysql -uzabbix -pmy_password -h<host>
zabbix-db_1         |
zabbix-db_1         |     For security reasons, you might want to change the above password.
zabbix-db_1         |     The 'root' user has no password but only allows local connections
zabbix-db_1         | ========================================================================
zabbix-server_1     | [LOG 16:09:58] Database server is available
zabbix-server_1     | [LOG 16:09:58] Checking if database exists or SQL import is required
zabbix-server_1     | [WARNING 16:09:58] Zabbix database doesn't exist. Installing and importing default settings
zabbix-server_1     |
zabbix-server_1     | [LOG 16:09:58] Database and user created, importing default SQL
zabbix-server_1     |
zabbix-server_1     | [LOG 16:10:19] Import finished, starting
zabbix-server_1     | [LOG 16:10:20] Starting Zabbix version 3.0.0rc1
zabbix-server_1     | 2016
zabbix-server_1     | 2016-02-02 16:10:24,452 CRIT Supervisor running as root (no user in config file)
zabbix-server_1     | 2016-02-02 16:10:24,452 WARN Included extra file "/etc/supervisor.d/zabbix-server.conf" during parsing

I login to container
docker exec -it zabbix30_zabbix-server_1 bash -c "export TERM=xterm; exec bash"

and try run
mysqladmin -hzabbix.db -uzabbix -pmy_password status
and got
Uptime: 968 Threads: 23 Questions: 5744 Slow queries: 1165 Opens: 550 Flush tables: 1 Open tables: 127 Queries per second avg: 5.933

It looks like I'm working with temporary base

What am I doing wrong?

Dockerfile and docker-compose.yml is default:

docker-compose.yml:
https://github.com/zabbix/zabbix-community-docker/blob/360e7f9bada79d794f1e91cf780f6a7862063b26/Dockerfile/zabbix-3.0/docker-compose.yml

Dockerfile:
https://github.com/zabbix/zabbix-community-docker/blob/e5c550404c554ce9ef6da51ebee525e7ea3eef5a/Dockerfile/zabbix-3.0/Dockerfile

Ubuntu 14.04

Custom config issue

if [ -f /etc/custom-config/zabbix_server.conf ]; then
FZS_DBPassword=$(grep ^DBPassword= /etc/custom-config/zabbix_server.conf | awk -F= '{print $2}')
if [ ! -z "$VAR" ]; then

why VAR?
it stoping then cuscom config loaded

Is Zabbix agent XXL required?

If I use Zabbix XXL for the zabbix-server, is it mandatory that the agents use Zabbix agent XXL? Does this work for native zabbix agents?

startup takes several minutes for zabbix-xxl:latest

I'm using such docker-compose configuration to launch zabbix backend service

zabbix-backend:
  image: monitoringartist/zabbix-xxl:latest
  mem_limit: 4294967296
  ports:
    - "10051:10051"
  volumes:
    - /etc/localtime:/etc/localtime:ro
  environment:
    - XXL_api=false
    - XXL_searcher=false
    - XXL_analytics=false
    - ZW_enabled=false
    - ZS_DBHost=*******
    - ZS_DBUser=zabbix
    - ZS_DBPassword=********
    - ZA_Hostname=Zabbix BackEnd
    - ZS_CacheSize=128M
    - ZS_StartDBSyncers=4
    - ZS_StartPollers=256
    - ZS_StartPollersUnreachable=8
    - ZS_HistoryCacheSize=16M
    - ZS_TrendCacheSize=16M
    - ZS_ValueCacheSize=48M

It takes up to 5 minutes for this container to start, and I see these errors while it's starting

zabbix-backend_1   | [LOG 20:13:19] Waiting for API, it's still not available
zabbix-backend_1   | [LOG 20:13:24] Waiting for API, it's still not available
zabbix-backend_1   | [LOG 20:13:29] Waiting for API, it's still not available
zabbix-backend_1   | [LOG 20:13:34] Waiting for API, it's still not available
zabbix-backend_1   | [LOG 20:13:39] Waiting for API, it's still not available

Can I somehow really disable that API calls?

ICMP fping

Need to fix:

docker exec zabbix-server chown root:zabbix /usr/local/sbin/fping
docker exec zabbix-server chmod 4710 /usr/local/sbin/fping

default env $JAVA didn't work

Default environment JAVA is not work....

[root@zabbix-server /]# /usr/local/sbin/zabbix_java/startup.sh
/usr/local/sbin/zabbix_java/startup.sh: line 62: /usr/lib/jvm/java-1.8.0-openjdk/bin/java: No such file or directory
Zabbix Java Gateway did not start

[root@zabbix-server /]# export JAVA=/usr/bin/java
[root@zabbix-server /]# 
[root@zabbix-server /]# 
[root@zabbix-server /]# /usr/local/sbin/zabbix_java/startup.sh
[root@zabbix-server /]# 

My image is zabbix/zabbix-server-2.4:2.4.6 and image id is 386aabf345d2

I found the docker-hub's image is not match with dockerfile in github....

Clusterazaion

Hi, we are using your code, we wanted to know if maria-db supports clusterazation.

Thanks.

Include schema files?

Perhaps I'm doing it the wrong way, but since this docker version of zabbix requires a separate mysql container (which I agree with!), perhaps it would be nice to include the needed schema files somewhere in the base structure. While not world-ending, I had to download the tarfile to grab the schema files with which to create my mysql container- it was just another several minutes and steps that could perhaps be avoided. Or, maybe even generate an official zabbix-mysql container that already has the user and schemas loaded? Just a thought. Thanks

... or am I doing it wrong? :)

Split into various service containers and link to each other

Why don't have each service in a separate container ?

Ex.:

  • zabbix-web - just nginx and php-fpm and zabbix-web
  • zabbix-server - just the server, could use some minimal image, like alpine
  • zabbix-agent - using --privileged and mapping local files via -v could be used to monitor the host
  • zabbix-server-jmx (maybe even split an --enable-java docker image, for have

All images prepared to receive environment variables to connect to other services/containers and have config files replaced.

I have https://github.com/endersonmaia/docker-zabbix-server and https://github.com/endersonmaia/docker-zabbix-web, but are not updated.

Maybe I'll make a PR to some of the topics above.

No route to host from zabbix-server container to docker host

Hi,
I've tried to add the docker host as a linux host to be monitored by zabbix but I get "no route to host",
The host docker0 bridge ip is: 172.18.0.1
The zabbix container ip is: 172.18.0.2
Executing in host "telnet 172.18.0.1 10050" allows connection.
Executing in zabbix container "telnet 172.18.0.2 10050" outputs "no route to host".
However I can ssh from container to host normally "ssh 172.18.0.2".
Host firewall is disabled but I couldn't check zabbix container firewall due to error "Failed to get D-Bus connection: Operation not permitted" when running systemctl related commands.
What I'm missing?
Cheers,
Jacq

Unable to execute fping as the zabbix user

Hi,

I am using zabbix/zabbix-server-2.4:2.4.7. When using the Template ICMP Ping template the following error showed up:

screen shot 2015-12-05 at 8 47 19 pm

It seems like the zabbix user was not able to run fping and fping6. I fixed this by running:

chmod ug+s /usr/sbin/fping
chmod ug+s /usr/sbin/fping6

Could this be added to the Dockerfile?

Thanks!

Broken SSL CAs

The ...

### Option: SSLCALocation
#       Override the location of certificate authority (CA) files for SSL server certificate verification.
#       If not set, system-wide directory will be used.
#       This parameter is used only in web monitoring.
#
# Mandatory: no
# Default:
# SSLCALocation=
SSLCALocation=

... part of config breaks CA for zabbix: enabling the SSL verify * options for smtp cause Problem with the SSL CA cert (path? access rights?): server response timeout errors. Using custom zabbix_server.conf without this line fixes the issue.

Default installation is not working

Hi, I`m just learning Docker, choose Zabbix as a first try.

I copy your commands from - Standard Dockerized Zabbix deployement
Zabbix Server is ok, but no data received from agent.

now I check logs and see:
996:20160311:101138.163 cannot send list of active checks to "127.0.0.1": host [Zabbix server] not monitored - From Server.

1009:20160311:101338.190 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored - from Agent.

DNS settings

Couldn't connect to server: Failed connect to myintranetdomain:80; No route to host

myintranetdomain is an internal and resolvable domain only by our own DNS server.

How can I change DNS settings?

App fails to start with docker-compose

Hi there,

I'm unable to reliably get the service to come up when using docker-compose. The first time I attempt to start, the server gets stuck with the following:

zabbix-db_1      | 
zabbix-db_1      | Creating DB admin user...
zabbix-db_1      | 
zabbix-db_1      | => Creating MariaDB user 'zabbix' with 'adminm3' password.
zabbix-db_1      |     ========================================================================
zabbix-db_1      |     You can now connect to this MariaDB Server using:                   
zabbix-db_1      |     mysql -uzabbix -padminm3 -h<host>                      
zabbix-db_1      |                                                                         
zabbix-db_1      |     For security reasons, you might want to change the above password.  
zabbix-db_1      |     The 'root' user has no password but only allows local connections   
zabbix-db_1      |     ========================================================================
zabbix-server_1  | [LOG 01:05:55] Waiting for API, it's still not available
zabbix-server_1  | [LOG 01:05:56] Database server is available
zabbix-server_1  | [LOG 01:05:56] Checking if database exists or SQL import is required
zabbix-server_1  | [WARNING 01:05:56] Zabbix database doesn't exist. Installing and importing default settings
zabbix-server_1  | [LOG 01:05:56] Database and user created, importing default SQL
zabbix-server_1  | [LOG 01:06:00] Waiting for API, it's still not available
zabbix-server_1  | [LOG 01:06:05] Waiting for API, it's still not available
zabbix-server_1  | [LOG 01:06:10] Waiting for API, it's still not available
zabbix-server_1  | [LOG 01:06:15] Waiting for API, it's still not available

If I take it down and then bring it back up, the app server keeps respawning with the following and never comes up properly:

zabbix-server_1  | Starting Zabbix Server. Zabbix 3.0.4 (2016-08-25) (revision 61185).
zabbix-server_1  | Press Ctrl+C to exit.
zabbix-server_1  | 
zabbix-server_1  |    422:20160902:010959.074 Starting Zabbix Server. Zabbix 3.0.4 (2016-08-25) (revision 61185).
zabbix-server_1  | 
zabbix-server_1  | 2016-09-02 01:09:59,075 DEBG 'zabbix-server' stdout output:
zabbix-server_1  |    422:20160902:010959.075 ****** Enabled features ******
zabbix-server_1  |    422:20160902:010959.075 SNMP monitoring:           YES
zabbix-server_1  |    422:20160902:010959.075 IPMI monitoring:           YES
zabbix-server_1  |    422:20160902:010959.075 Web monitoring:            YES
zabbix-server_1  | 
zabbix-server_1  | 2016-09-02 01:09:59,076 DEBG 'zabbix-server' stdout output:
zabbix-server_1  |    422:20160902:010959.075 VMware monitoring:         YES
zabbix-server_1  |    422:20160902:010959.075 SMTP authentication:       YES
zabbix-server_1  |    422:20160902:010959.075 Jabber notifications:      YES
zabbix-server_1  |    422:20160902:010959.075 Ez Texting notifications:  YES
zabbix-server_1  |    422:20160902:010959.075 ODBC:                      YES
zabbix-server_1  |    422:20160902:010959.075 SSH2 support:              YES
zabbix-server_1  |    422:20160902:010959.075 IPv6 support:              YES
zabbix-server_1  |    422:20160902:010959.075 TLS support:               YES
zabbix-server_1  |    422:20160902:010959.075 ******************************
zabbix-server_1  |    422:20160902:010959.075 using configuration file: /usr/local/etc/zabbix_server.conf
zabbix-server_1  | 
zabbix-server_1  | 2016-09-02 01:09:59,081 DEBG 'zabbix-server' stdout output:
zabbix-server_1  |    422:20160902:010959.081 cannot use database "zabbix": Zabbix server cannot work with a Zabbix proxy database
zabbix-server_1  | 
zabbix-server_1  | 2016-09-02 01:10:00,086 INFO success: zabbix-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
zabbix-server_1  | 2016-09-02 01:10:01,088 DEBG fd 19 closed, stopped monitoring <POutputDispatcher at 41009096 for <Subprocess at 40435512 with name zabbix-server in state RUNNING> (stdout)>
zabbix-server_1  | 2016-09-02 01:10:01,088 DEBG fd 25 closed, stopped monitoring <POutputDispatcher at 41008952 for <Subprocess at 40435512 with name zabbix-server in state RUNNING> (stderr)>
zabbix-server_1  | 2016-09-02 01:10:01,088 INFO exited: zabbix-server (exit status 232; not expected)
zabbix-server_1  | 2016-09-02 01:10:01,089 DEBG received SIGCLD indicating a child quit
zabbix-server_1  | 2016-09-02 01:10:02,098 INFO spawned: 'zabbix-server' with pid 425
zabbix-server_1  | 2016-09-02 01:10:02,120 DEBG 'zabbix-server' stdout output:
zabbix-server_1  | Starting Zabbix Server. Zabbix 3.0.4 (2016-08-25) (revision 61185).

Here is the compose file that I'm working with. Running the latest version of Docker for Mac, 1.12.1-beta24. Also had very similar issues with it in Ubuntu. I've also attempted to use the (only slightly different) docker-compose file from the repo to the same result.

version: "2"
services:
    zabbix-db:
      image: zabbix/zabbix-db-mariadb
      volumes:
        - zabbix_backups:/backups
        - /etc/localtime:/etc/localtime:ro
        - zabbix_db_storage:/var/lib/mysql
      environment:
        - MARIADB_USER=zabbix
        - MARIADB_PASS=adminm3
      restart: always

    zabbix-server:
      image: monitoringartist/zabbix-3.0-xxl:latest
      ports:
        - "8085:80"
        - "10051:10051"
      volumes:
        - /etc/localtime:/etc/localtime:ro
      links:
        - zabbix-db:zabbix.db
      environment:
        - ZS_DBHost=zabbix.db
        - ZS_DBUser=zabbix
        - ZS_DBPassword=adminm3
        - ZS_StartVMwareCollectors=1
        - ZS_StartIPMIPollers=3
        - XXL_grapher=true
        - XXL_analytics=false
      restart: always

volumes:
    zabbix_db_storage:
        driver: local
    zabbix_backups:
        driver: local

Hopefully someone with a bit more direct experience with these repos can help provide some insight.

-Mitch

Backup of DB command not working

This command is listed on Docker Zabbix page here

docker exec \
    -ti zabbix-db \
    bash -c "\
    mysqldump -u zabbix -p my_password zabbix | \
    bzip2 -cq9 > /backups/zabbix_db_dump_$(date +%Y-%m-%d-%H.%M.%S).sql.bz2"

I got this error message

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.