- 安装mariadb(mysql)
// 执行安装命令
# yum -y install mariadb mariadb-server mariadb-devel
// 启动服务
# systemctl start mariadb
// 设置为开机启动
# systemctl enable mariadb
// 修改root登录密码
# mysql_secure_installation
Enter current password for root (enter for none): [回车]
Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
// 测试登陆
# mysql -uroot -ppassword
// 设置root访问权限
# mysql -uroot -ppassword
MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' identified by 'qwe123' with grant option;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;
- 安装依赖库
# yum -y install gcc net-snmp-devel libssh2-devel
- 下载源码,并配置安装
下载地址:
https://www.zabbix.com/download
https://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.4/zabbix-3.4.4.tar.gz
上传zabbix-3.4.4.tar.gz到/home目录下
# cd /home
# tar -zxf zabbix-3.4.4.tar.gz
# cd zabbix-3.4.4
# ./configure --prefix=/usr/local/zabbix --enable-proxy --with-net-snmp --with-mysql --with-ssh2
# make && make install
- 初始化数据
# mysql -uroot -ppassword
MariaDB [none]> create database if not exists zabbix_proxy default character set utf8 collate utf8_general_ci;
MariaDB [none]> use zabbix_proxy;
MariaDB [zabbix]> source /home/zabbix-3.4.4/database/mysql/schema.sql;
- 安装fping
zabbix 3之后把ping更换为fping了,所以需要安装fping
# wget http://www.fping.org/dist/fping-4.0.tar.gz
# tar -zxvf fping-4.0.tar.gz
# cd fping-4.0
# ./configure --prefix=/usr/local/fping
# make && make install
- 配置
// server配置
# cd /usr/local/zabbix/
# vi ./etc/zabbix_proxy.conf
ProxyMode=0
Server=192.168.31.199(zabbix server)
Hostname=proxy01
DBHost=localhost
DBName=zabbix_proxy
DBUser=root
DBPassword=password
AllowRoot=1
FpingLocation=/usr/local/fping/sbin/fping
- 关闭防火墙
# systemctl stop firewalld
# setenforce 0
# vi /etc/selinux/config
SELINUX=disabled
- 启动服务
# /usr/local/zabbix/sbin/zabbix_proxy
- 在zabbix控制台
创建agent代理程序
创建agent代理程序
网友评论