1.准备LNMP环境,
2.下载并解压zabbix包:
下载地址 :https://sourceforge.net/p/zabbix/activity/?page=0&limit=100#5e836904f0d3473e24304e3d
解压 tar -zxvf zabbix-4.0.33.tar.gz
3.安装依赖:yum install libxml2-devel net-snmp-devel libevent-devel curl-devel pcre*
4../configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-proxy --with-mysql=/usr/local/mysql/bin/mysql_config --enable-ipv6 --with-net-
出现报错:
checking size of void *... 8
checking for mysql_config... /usr/local/mysql/bin/mysql_config
configure: error: MySQL library not found
5.出现问题是没有找到mysql_config,查找文件证明确实没有
[root@localhost zabbix-4.0.33]# find / -name "mysql_config*"
/usr/bin/mysql_config_editor
/usr/share/man/man1/mysql_config_editor.1.gz
6.mysql是rpm包装的,通过命令查找,发现没有mysql_devel包,需要下载对应版本的:http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/
快捷方式:yum install mysql-devel 直接安装成功。
[root@localhost /]# rpm -aq | grep mysql
mysql-community-server-5.6.51-2.el7.x86_64
mysql-community-release-el7-5.noarch
mysql-community-common-5.6.51-2.el7.x86_64
mysql-community-libs-5.6.51-2.el7.x86_64
mysql-community-client-5.6.51-2.el7.x86_64
7.找到上面6中文件的所在位置,上传并解压
[root@localhost doc]# rpm -ivh mysql-community-devel-5.6.51-2.el6.x86_64.rpm
8.重新执行配置源代码命令,显示如下则成功。
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************