1 引言
本篇笔记接上篇:
https://blog.csdn.net/qq_35550345/article/details/102545276
zabbix-server的安装好并且在web页面配置完成后安装zabbix-proxy和node1(作为被监控节点)
2 安装配置proxy
- 关闭防火墙参照https://blog.csdn.net/qq_35550345/article/details/102545276
- 配置yum源
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
- 安装配置MariaDB
1)安装
yum -y install mariadb mariadb-server php php-mysql httpd
2)配置数据库
systemctl enable mariadb.service
systemctl start mariadb.service
初始化数据库并配置数据库授权
mysql_secure_installation //此处设置root的数据库密码为123456
mysql -uroot -p123456 -e “create database zabbix_proxy default character set utf8 collate utf8_bin;”
mysql -uroot -p123456 -e "grant all privileges on zabbix_proxy.* to zabbix@’%’ identified by ‘zabbix’; "
cd /usr/share/doc/zabbix-server-mysql-3.4.15
zcat create.sql.gz | mysql -uroot -p123456 zabbix
3)重启http
systemctl enable httpd
systemctl start httpd.service
- 搭建proxy
yum install -y zabbix-proxy zabbix-proxy-mysql zabbix-agent
- vim /etc/zabbix/zabbix_proxy.conf
Server=172.16.212.129
Hostname=proxy
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_proxy.pid
SocketDir=/var/run/zabbix
DBHost=localhost
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=zabbix
DataSenderFrequency=1
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
- vim /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=172.16.212.129
ServerActive=172.16.212.129
Hostname=proxy
Include=/etc/zabbix/zabbix_agentd.d/*.conf
systemctl enable zabbix-proxy zabbix-agent
systemctl start zabbix-proxy zabbix-agent
- 如果没有设置DNS解析,还需修改server proxy和node1上的/etc/hosts文件
- vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.212.129 server01
172.16.212.131 node1
172.16.212.132 proxy
3 node1上安装配置zabbix-agent
参照https://blog.csdn.net/qq_35550345/article/details/102545276 的2.3小节
4 web页面添加proxy和自动发现
比如我的操作完之后就是:
继续:
创建之后可以在页面查看graphs: