AWS Ec2를 Ubuntu20.4로 생성한다.
zabbix 구성 image들을 다운로드합니다.
docker pull mysql
docker pull zabbix/zabbix-server-mysql
docker pull zabbix/zabbix-web-nginx-mysql
docker pull zabbix/zabbix-java-gateway
docker pull zabbix/zabbix-agent입력하세요
docker run --name mysql-server -t -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="비밀번호" -e MYSQL_ROOT_PASSWORD="root비밀번호" -d mysql --character-set-server=utf8 --collation-server=utf8_bin --default-authentication-plugin=mysql_native_password
패스워드 주의
restart 옵션이 없으므로, zabbix 서버 재부팅시 mysql 부터 시작해야 한다.
docker run --name zabbix-java-gateway -t --restart unless-stopped -d zabbix/zabbix-java-gateway
docker run --name zabbix-server-mysql -t -e DB_SERVER_HOST="mysql-server" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="비밀번호" -e MYSQL_ROOT_PASSWORD="비밀번호" -e ZBX_JAVAGATEWAY="zabbix-java-gateway" --link mysql-server:mysql --link zabbix-java-gateway:zabbix-java-gateway -p 10051:10051 --restart unless-stopped -d zabbix/zabbix-server-mysql
docker run --name zabbix-web-nginx-mysql -t -e DB_SERVER_HOST="mysql-server" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="비밀번호" -e MYSQL_ROOT_PASSWORD="비밀번호" --link mysql-server:mysql --link zabbix-server-mysql:zabbix-server -p 8080:8080 --restart unless-stopped -d zabbix/zabbix-web-nginx-mysql
docker run --name zabbix-agent --link mysql-server:mysql --link zabbix-server-mysql:zabbix-server -e ZBX_HOSTNAME="Zabbix server" -e ZBX_SERVER_HOST="zabbix-server" -d zabbix/zabbix-agent
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
87f9453b56db zabbix/zabbix-agent "/sbin/tini -- /usr/…" 8 minutes ago Up 8 minutes 10050/tcp zabbix-agent
493d711f412f zabbix/zabbix-web-nginx-mysql "docker-entrypoint.sh" 9 minutes ago Up 9 minutes 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 8443/tcp zabbix-web-nginx-mysql
e2ab514284af zabbix/zabbix-server-mysql "/sbin/tini -- /usr/…" 12 minutes ago Up 12 minutes 0.0.0.0:10051->10051/tcp, :::10051->10051/tcp zabbix-server-mysql
17511de57c96 zabbix/zabbix-java-gateway "docker-entrypoint.s…" 13 minutes ago Up 13 minutes 10052/tcp zabbix-java-gateway
cfcdf969b2ab mysql "docker-entrypoint.s…" 13 minutes ago Up 13 minutes 3306/tcp, 33060/tcp mysql-server
docker inspect zabbix-agent | grep "IPAddress\": "
"IPAddress": "172.17.0.6",
"IPAddress": "172.17.0.6",
좌측 메뉴 > Configuration > Hosts 열기
Zabbix server 클릭
ip를 zabbix agent의 ip 172.17.0.6 으로 변경 후 저장
잠시 후 초록색이면 정상