1、编译安装zabbix proxy
1 2 3 |
# tar -zxvf zabbix-4.2.8.tar.gz
# cd zabbix-4.2.8/
# ./configure --prefix=/usr/local/zabbix-4.2.8 --enable-proxy --with-mysql --with-net-snmp --with-libcurl
|
报错如下:
configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config
解决办法:yum install -y net-snmp-devel
# make && make install
2、创建数据库,并授权;
mysql> create database zabbix_proxy character set utf8;
mysql> grant all on zabbix_proxy.* to zabbix_proxy@localhost identified by '123456';
mysql> flush privileges;
mysql> quit
导入数据
1 |
[root@localhost zabbix-4.2.8] # mysql --default-character-set=utf8 zabbix_proxy < database/mysql/schema.sql
|
zabbix server与proxy需要数据库,angent不需要。尤其要注意的是proxy只需要导入一个表结构schema.sql即可。
3、修改proxy配置文件,并启动proxy
1 2 3 4 5 6 7 8 9 10 |
[root@localhost zabbix-4.2.8] # egrep -v '#|^$' etc/zabbix_proxy.conf
Server=192.168.20.10
Hostname=Zabbix_proxy
LogFile= /tmp/zabbix_proxy .log
DBHost=localhost
DBName=zabbix_proxy
DBUser=zabbix_proxy
DBPassword=123456
ConfigFrequency=60
DataSenderFrequency=5
|
[root@localhost zabbix-2.2.9]# /usr/local/zabbix-2.2.9/sbin/zabbix_proxy
启动报错如下:提示没有找到共享库文件
./sbin/zabbix_proxy: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
解决方法:
# echo “/usr/local/mysql/lib” >>/etc/ld.so.conf
# ldconfig
# /usr/local/zabbix-2.2.9/sbin/zabbix_proxy
再次启动,报错如下,没有创建zabbix用户
zabbix_proxy [21350]: user zabbix does not exist
zabbix_proxy [21350]: cannot run as root!
解决方法:
[root@localhost zabbix-2.2.9]# groupadd zabbix
[root@localhost zabbix-2.2.9]# useradd -g zabbix zabbix
4、web页面添加proxy节点
标签:--,zabbix,proxy,mysql,root,localhost,分布式 From: https://www.cnblogs.com/A121/p/17806589.html