在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:docker-zabbix开源软件地址:https://gitee.com/yyljlyy/docker-zabbix开源软件介绍:在Docker中使用Zabbix 进行监控Container容器提供了以下* Zabbix服务*,请参阅[ Zabbix文件](http://www.zabbix.com/)附加信息。
如何使用你可以执行以下命令运行Zabbix服务. docker run -d -P --name zabbix berngp/docker-zabbix 上面的命令要求在docker跑berngp/docker-zabbix镜像的时候开放所有** Zabbix **指定所有本地端口去运行实例。运行 打开 一个将端口 $ docker ps -f name=zabbixCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES970eb1571545 berngp/docker-zabbix:latest "/bin/bash /start.sh 18 hours ago Up 2 hours 0.0.0.0:49181->10051/tcp, 0.0.0.0:49182->10052/tcp, 0.0.0.0:49183->2812/tcp, 0.0.0.0:49184->80/tcp zabbix 如果你想在Docker主机绑定容器特定的端口,你可以执行以下命令: docker run -d \ -p 10051:10051 \ -p 10052:10052 \ -p 80:80 \ -p 2812:2812 \ --name zabbix \ berngp/docker-zabbix 上面的命令会* Zabbix服务通过 10051 端口启动,而Web界面则通过 80 *端口运行名字是 以上都做完了Zabbix Web UI 就已经运行了 你可以通过 Apparmor 细节 (仅仅在Debian和Ubuntu)如果你想容器使用Monit控制和监视各个进程, 你需要配置Docker的默认Apparmor配置文件. 目前,唯一的办法就是添加 --cap-add SYS_PTRACE --security-opt apparmor:unconfined 如果添加vast号日志信息写入你得你的系统日志,并每10秒跟踪一次进程! 挖掘Docker Zabbix 容器如果你想查看部署运行容器的内容, 你可以通过如下命令 bash shell through docker's exec .执行以下命令. docker exec -i -t zabbix /bin/bash 问题和错误.你可以随时提出任何问题 here. 开发者我建议你通过发行版建立Docker, 如果你使用的是 Mac OSX 我建议你利用 boot2docker, 你也可以使用Vagrantfile 创建一个_Docker_环境. 用Vagrantfile文件设置你得Docker环境运行其中包含的 Vagrantfile 文件你需要安装VirtualBox 和 Vagrant . 实际中我使用了_VirtualBox_ 4.3.6 和_Vagrant_ 1.4.1.使用_Vagrantfile_ 构建一个最小化的_Ubuntu 64_ 操作系统_VirtualBox Guest Additions_ along with Docker and its dependencies. 第一次你需要执行 Be aware that the Vagrantfile depends on the version of VirtualBox and may run into problems if you don't have the latest versions. 创建Docker Zabbix 仓库.Within an environment that is already running docker, checkout the docker-zabbix code to a known directory. If you are using the Vagrantfile, as mentioned above, it will be available by default in the e.g. # 进入容器构建代码目录.cd /docker/docker-zabbix# 构建容器.docker build -t berngp/docker-zabbix .#启动他!docker run -i -t -P --name=zabbix berngp/docker-zabbix 资源来自:祝你玩的愉快!ContainerThe container provides the following Zabbix Services, please refer to the Zabbix documentation for additional info.
UsageYou can run Zabbix as a service executing the following command. docker run -d -P --name zabbix berngp/docker-zabbix The command above is requesting docker to run the berngp/docker-zabbix image in the background, publishing all ports to the host interface assigning the name of zabbix to the running instance.Run Open In the example bellow the container's port $ docker ps -f name=zabbixCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES970eb1571545 berngp/docker-zabbix:latest "/bin/bash /start.sh 18 hours ago Up 2 hours 0.0.0.0:49181->10051/tcp, 0.0.0.0:49182->10052/tcp, 0.0.0.0:49183->2812/tcp, 0.0.0.0:49184->80/tcp zabbix If you want to bind the container's port with specific ports from the host running the docker daemon you can execute the following: docker run -d \ -p 10051:10051 \ -p 10052:10052 \ -p 80:80 \ -p 2812:2812 \ --name zabbix \ berngp/docker-zabbix The above command will expose the Zabbix Server through port 10051 and the Web UI through port 80 on the host instance, among others and associate it with the name After the container is ready the Zabbix Web UI should be available at Apparmor Specifics (Debian and Ubuntu)The container uses Monit for controlling and observing the individual processes, which requires capabilities denied by Docker's default Apparmor profile. Currently, the only workaround is to add the --cap-add SYS_PTRACE --security-opt apparmor:unconfined Not doing so will result in a vast number of log messages polluting your syslog, as Monit tries to trace the processes all 10 seconds! Exploring the Docker Zabbix ContainerSometimes you might just want to review how things are deployed inside a running container, you can do this by executing a bash shell through docker's exec command.Execute the command bellow to do it. docker exec -i -t zabbix /bin/bash Issues and Bugs.Feel free to report any problems here. DevelopersI suggest you install docker through your distribution, if using Mac OSX I suggest you leverage boot2docker, as an option the project has a Vagrantfile that you can use to create a virtual instance with Docker. Setting your Docker environment with the VagrantfileTo run the included Vagrantfile you will need VirtualBox and Vagrant installed. Currently I am testing it against VirtualBox 4.3.6 and Vagrant 1.4.1. The Vagrantfile uses a minimal Ubuntu Precise 64 box and installs the VirtualBox Guest Additions along with Docker and its dependencies. The first time you execute a Be aware that the Vagrantfile depends on the version of VirtualBox and may run into problems if you don't have the latest versions. Building the Docker Zabbix Repository.Within an environment that is already running docker, checkout the docker-zabbix code to a known directory. If you are using the Vagrantfile, as mentioned above, it will be available by default in the e.g. # CD into the docker container code.cd /docker/docker-zabbix# Build the contaienr code.docker build -t berngp/docker-zabbix .# Run it!docker run -i -t -P --name=zabbix berngp/docker-zabbix Contributing.Appreciate any contribution regardless of the size. If your contribution is associated with any reported issue please add the details in the comments of the PR (Pull Request). Contributions from:Thank you and happy metrics gathering! |
请发表评论