docker run -d -v /home/zabbix/mysql --name zabbix-db-storage busybox:latestdocker run -d --name zabbix-db -v /home/zabbix/backups:/backups -v /etc/localtime:/etc/localtime:ro --volumes-from zabbix-db-storage --env="MARIADB_USER=zabbix" --env="MARIADB_PASS=my_password" monitoringartist/zabbix-db-mariadbdocker 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" --env="PHP_memory_limit=512M" monitoringartist/zabbix-xxl:latest
往容器内拷贝字体
docker cp simkai.ttf zabbix:/usr/local/src/zabbix/frontends/php/fonts/ 字体路径 /usr/local/src/zabbix/frontends/php/fonts/simkai.ttf进入docker docker exec -it zabbix /bin/bash php配置文件路径,修改字体文件 vi /usr/local/src/zabbix/frontends/php/include/defines.inc.phpdefine('ZBX_GRAPH_FONT_NAME', 'simkai');define('ZBX_FONT_NAME', 'simkai');
zabbix-server配置文件
vi /usr/local/etc/zabbix_server.conf zabbix-server报警文件 cd /usr/local/share/zabbix/alertscripts/scp 172.18.1.20:/remote/scripts/sendmail.sh ./docker exec -it zabbix /bin/bashyum install -y mailxyum install -y dos2unix## 确保sendmail.sh能够执行成功vi /etc/mail.rc##插入以下内容set from=message@le-yao.comset smtp=smtp.exmail.qq.comset smtp-auth-user=message@le-yao.comset smtp-auth-password=Leyao@2016set smtp-auth=login
重启docker
docker restart zabbix
迁移
docker exec -it zabbix-db /bin/bashmysql -uzabbix -pmy_passworduse zabbix;source /backups/zabbix2.sql;SET collation_server = utf8_general_ci;SET collation_database = utf8_general_ci;SET collation_connection = utf8_general_ci;