原 【DB宝39】使用Docker分分钟搭建Zabbix 5.0配置MySQL监控
Tags: 原创LinuxMySQLDocker监控其它Zabbix
一、部署Zabbix 5.0环境
1.1、下载Zabbix 5.0镜像
1 2 3 4 5 6 7 | [root@docker36 ~]# docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/lhrzabbix5:1.0 1.0: Pulling from lhrbest/lhrzabbix5 c1e1cb5fc6d2: Already exists f36cbc8bf71f: Pull complete Digest: sha256:5e22edb3347a27a731bd48742c982e34dcbcd47b63db2e9b64549ad69488475e Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/lhrbest/lhrzabbix5:1.0 registry.cn-hangzhou.aliyuncs.com/lhrbest/lhrzabbix5:1.0 |
1.2、创建镜像
1 2 3 4 5 6 7 8 9 10 11 12 | [root@docker36 ~]# docker run -d --name lhrzabbix5 -h lhrzabbix5 \ > -p 225:22 -p 23306:3306 -p 280:80 -p 20051:10051 \ > -v /sys/fs/cgroup:/sys/fs/cgroup \ > --privileged=true \ > lhrbest/lhrzabbix5:1.0 /usr/sbin/init Unable to find image 'lhrbest/lhrzabbix5:1.0' locally 1.0: Pulling from lhrbest/lhrzabbix5 Digest: sha256:5e22edb3347a27a731bd48742c982e34dcbcd47b63db2e9b64549ad69488475e Status: Downloaded newer image for lhrbest/lhrzabbix5:1.0 7fa309da58043680aa0fa14b0692b35249ad5557d5d4cf0d0897a29afad13256 [root@docker36 ~]# docker exec -it lhrzabbix5 bash [root@lhrzabbix5 /]# |
1.3、浏览器访问
访问Zabbix:http://192.168.66.36:280/zabbix
默认用户名密码:Admin/zabbix
二、监控Linux主机
监控Linux主机可以通过snmp(Simple Network Management Protocol)简单网络管理协议,也可以通过zabbix-agent监控。本文使用snmp来配置。
1 2 3 4 5 | yum install -y net-snmp net-snmp-utils systemctl start snmpd systemctl status snmpd systemctl enable snmpd |
配置文件:vi /etc/snmp/snmpd.conf,添加如下内容:
1 | view systemview included .1 |
启动snmpd: