赞
踩
zabbix_agent部署:
建议:zabbix_agent使用docker-compose方式单独部署
启动方式:
1、run方式启动
docker run --rm --network zabbix --name zabbix_agent--link zabbix_server:zabbix-server -e ZBX_HOSTNAME="mythird" -e ZBX_SERVER_PORT="10051" -e ZBX_SERVER_HOST="172.22.0.3" -p 3998:10050 -d zabbix/zabbix-agent:alpine-3.0-latest
2、docker-compose.yml
目录结构:
- [root@container1 zabbix_agent]# cat etc/env_agent
- ZBX_SERVER_HOST=172.22.0.3
- ZBX_SERVER_PORT=10051
- ZBX_HOSTNAME=kgtest
- ZBX_LISTENPORT=3050
- ZBX_LOGTYPE=file
- ZBX_LOGFILE=/tmp/zabbix_agentd.log
a、与zabbix_server/zabbix_proxy部署在同一个docker-compose.yml时,唯一的区别是:links的设置,其格式:servicename: name of zabbix
- zabbix_agent:
- image: zabbix/zabbix-agent:alpine-3.0-latest
- container_name: zabbix_agent
- ports:
- - "10050:10050"
- environment:
- ZBX_HOSTNAME: kg
- volumes:
- - /etc/localtime:/etc/localtime:ro
- links:
- - zabbix_server:zabbix-server
- user: root
- privileged: true
- restart: always
- networks:
- - zabbix
b、单独部署:
A、docker的bridge模式:如果是在同一个机器上,需要使用和zabbix_server/zabbix_proxy相同的网络
- [root@container1 zabbix_agent]# cat docker-compose.yml
- version: "3"
- services:
- zabbix_agent:
- image: zabbix/zabbix-agent:alpine-3.0-latest
- container_name: zabbix_agent3
- ports:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。