1. Install database MySQL First
Docker run--name zabbix-mysql-server--hostname zabbix-mysql-server \
-E mysql_root_password= "123456" \
-E mysql_user= "Zabbix" \
-E mysql_password= "123456" \
-E mysql_database= "Zabbix" \
-P 3,306:3,306 \
-D \
Mysql
2. Create Zabbix-server
Docker run--name zabbix-server-mysql--hostname zabbix-server-mysql \
--link zabbix-mysql-server:mysql \
-e db_server_host= "MySQL" \
-E mysql_user= "Zabbix" \
-E mysql_database= "Zabbix" \
-E mysql_password= "123456" \
-v/etc/localtime:/etc/localtime:ro \
-v/data/docker/zabbix/alertscripts:/usr/lib/zabbix/alertscripts \
-v/data/docker/zabbix/externalscripts:/usr/lib/zabbix/externalscripts \
-P 10,051:10,051 \
-D \
Zabbix/zabbix-server-mysql
3. Last Web-nginx
Final installation Zabbix-web-nginx
Docker run--name zabbix-web-nginx-mysql--hostname zabbix-web-nginx-mysql \
--link zabbix-mysql-server:mysql \
--link zabbix-server-mysql:zabbix-server \
-e db_server_host= "MySQL" \
-E mysql_user= "Zabbix" \
-E mysql_password= "123456" \
-E mysql_database= "Zabbix" \
-E zbx_server_host= "Zabbix-server" \
-E php_tz= "Asia/shanghai" \
-P 8,000:80 \
-P 8,443:443 \
-D \
Zabbix/zabbix-web-nginx-mysql
Docker-zabbbix-agent Installation and link zabbix-server
Docker run--name zabbix-agent--link zabbix-server-mysql:zabbix-server-d zabbix/zabbix-agent:latest
Login Access Test
Browser Access ip:8000 View
Default Login
Username:admin
Password:zabbix
Docker-compose.yml
Version: ' 3 '
Services
Zabbix-mysql-server:
Container_name:zabbix-mysql-server
Image:mysql
Network_mode: "Bridge"
Restart:always
Ports
-"3,306:3,306"
Environment:
-mysql_root_password=123456
-Mysql_user=zabbix
-mysql_password=123456
-Mysql_database=zabbix
Volumes
-/opt/dbdata:/etc/dbdata
Zabbix-server-mysql:
Container_name:zabbix-server-mysql
Image:zabbix/zabbix-server-mysql:latest
Network_mode: "Bridge"
Restart:always
Ports
-"10,051:10,051"
Links
-Zabbix-mysql-server:mysql
Environment:
-Db_server_host=mysql
-Mysql_user=zabbix
-Mysql_database=zabbix
-mysql_password=123456
Volumes
-/etc/localtime:/etc/localtime:ro
-/opt/zabbix/alertscripts:/usr/lib/zabbix/alertscripts
-/opt/zabbix/externalscripts:/usr/lib/zabbix/externalscripts
Zabbix-web-nginx-mysql:
Container_name:zabbix-web-nginx-mysql
Image:zabbix/zabbix-web-nginx-mysql
Network_mode: "Bridge"
Restart:always
DEPENDS_ON:
-Zabbix-mysql-server
-Zabbix-server-mysql
Ports
-"8,000:80"
-"8,443:443"
Links
-Zabbix-mysql-server:mysql
-Zabbix-server-mysql:zabbix-server
Environment:
-Db_server_host=mysql
-Mysql_user=zabbix
-Mysql_database=zabbix
-mysql_password=123456
-Zbx_server_host=zabbix-server
-Php_tz=asia/shanghai
Volumes
-/etc/localtime:/etc/localtime:ro
-/opt/nginx:/opt/nginx
Zabbix-agent-a:
Container_name:zabbix-agent-a
Image:zabbix/zabbix-agent:latest
Network_mode: "Bridge"
Restart:always
Links
-Zabbix-server-mysql:zabbix-server
-Zabbix-web-nginx-mysql:zabbix-web
DEPENDS_ON:
-Zabbix-server-mysql
-Zabbix-web-nginx-mysql
Volumes
-/opt/zabbix-agent:/data/zabbix-agent
Environment:
-Zbx_hostname=zabbix-agent-a
-Zbx_server_host=zabbix-server
Zabbix-agent-b:
Container_name:zabbix-agent-b
Image:zabbix/zabbix-agent:latest
Network_mode: "Bridge"
Restart:always
Links
-Zabbix-server-mysql:zabbix-server
-Zabbix-web-nginx-mysql:zabbix-web
DEPENDS_ON:
-Zabbix-server-mysql
-Zabbix-web-nginx-mysql
Volumes
-/opt/zabbix-agent-b:/data/zabbix-agent-b
Environment:
-Zbx_hostname=zabbix-agent-b
-Zbx_server_host=zabbix-server
Docker installation Zabbix