一.安装zabbix-proxy 1.下载软件仓库 rpm -Uvh https://repo.zabbix.com/zabbix/7.0/alma/9/x86_64/zabbix-release-7.0-2.el9.noarch.rpm dnf clean all dnf makecache 2.安装 dnf install -y zabbix-proxy-mysql zabbix-sql-scripts zabbix-selinux-policy 二.安装mysql 1.下载mysql wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.37-1.el9.x86_64.rpm-bundle.tar 2.解压 mkdir mysql tar xf mysql-8.0.37-1.el9.x86_64.rpm-bundle.tar -C /root/mysql/ 3.安装 rpm -ivh mysql-community-* --force --nodeps 4.启动 systemctl start mysqld systemctl enable mysqld 5.数据库初始密码 cat /var/log/mysqld.log |grep passwd alter user 'root'@'localhost' identified by 'xxx'; 三、配置zabbix-proxy数据库 1.导入初始数据 mysql -uroot -p create database zabbix_proxy character set utf8mb4 collate utf8mb4_bin; create user zabbix_proxy@localhost identified by 'xxx'; grant all privileges on zabbix_proxy.* to zabbix_proxy@localhost; set global log_bin_trust_function_creators = 1; quit; cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql --default-character-set=utf8mb4 -uzabbix_proxy -p zabbix_proxy 导入初始架构和数据 set global log_bin_trust_function_creators = 0; 2.修改zabbix_proxy配置 /etc/zabbix/zabbix_proxy.conf
Server=192.168.137.110 #此处为zabbix-server的IP地址 Hostname=zabbixccr #服务器主机名 LogFile=/var/log/zabbix/zabbix_proxy.log LogFileSize=0 PidFile=/run/zabbix/zabbix_proxy.pid SocketDir=/run/zabbix DBName=zabbix_proxy DBUser=zabbix_proxy ProxyBufferMode=hybrid ProxyMemoryBufferSize=16M SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 LogSlowQueries=3000 StatsAllowedIP=127.0.0.1 DBPassword=xxx
四、关闭selinux、防火墙和启动服务 setenforce 0 systemctl stop firewalld systemctl disable firewalld systemctl restart zabbix-proxy systemctl enable zabbix-proxy 五、在zabbix server上创建proxy 管理--proxy--创建proxy 输入proxy名称(和配置文件中hostname保持一致)和代理地址 设置主机从proxy获取数据 六、客户端重新指向ip到proxy
cat /etc/zabbix/zabbix_agentd.conf |grep -Ev "^#|^$" Server=192.168.137.111 ServerActive=192.168.137.111
标签:zabbix7proxy,log,部署,--,zabbix,systemctl,proxy,mysql,almalinux9.4 From: https://www.cnblogs.com/sherq1989/p/18456776