系统环境:CentOS 7.5是最小化安装的
编译信息
编译选项: root@Server01 zabbix-4.0.0]# ./configure --prefix=/usr/share/applications/zabbix --enable-server --enable-agent --with-mysql=/usr/bin/mysql_config_editor --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2=/usr/lib64/libxml2.so 编译结果: Configuration: Detected OS: linux-gnu Install path: /usr/share/applications/zabbix Compilation arch: linux Compiler: cc Compiler flags: -g -O2 Library-specific flags: database: Net-SNMP: -I/usr/local/include -I/usr/lib64/perl5/CORE -I. -I/usr/include Enable server: yes Server details: With database: MySQL WEB Monitoring: cURL SSL certificates: /usr/share/applications/zabbix/share/zabbix/ssl/certs SSL keys: /usr/share/applications/zabbix/share/zabbix/ssl/keys Native Jabber: no SNMP: yes IPMI: no SSH: no TLS: no ODBC: no Linker flags: -L/usr/lib64 -rdynamic Libraries: -lxml2 -lnetsnmp -lz -lpthread -levent -lcurl -lm -ldl -lresolv -lpcre Configuration file: /usr/share/applications/zabbix/etc/zabbix_server.conf External scripts: /usr/share/applications/zabbix/share/zabbix/externalscripts Alert scripts: /usr/share/applications/zabbix/share/zabbix/alertscripts Modules: /usr/share/applications/zabbix/lib/modules Enable proxy: no Enable agent: yes Agent details: TLS: no Linker flags: -rdynamic Libraries: -lz -lpthread -lcurl -lm -ldl -lresolv -lpcre Configuration file: /usr/share/applications/zabbix/etc/zabbix_agentd.conf Modules: /usr/share/applications/zabbix/lib/modules Enable Java gateway: no LDAP support: no IPv6 support: yes *********************************************************** * Now run 'make install' * * * * Thank you for using Zabbix! * * <http://www.zabbix.com> * ***********************************************************
make install 报错
。。。。。。。。。。。。。。。 Making install in zbxcommshigh make[3]: Entering directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh' make[4]: Entering directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh' make[4]: Nothing to be done for `install-exec-am'. make[4]: Nothing to be done for `install-data-am'. make[4]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh' make[3]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxcommshigh' Making install in zbxdb make[3]: Entering directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxdb' cc -DHAVE_CONFIG_H -I. -I../../../include -g -O2 -MT libzbxdb_a-db.o -MD -MP -MF .deps/libzbxdb_a-db.Tpo -c -o libzbxdb_a-db.o `test -f 'db.c' || echo './'`db.c db.c:27:20: fatal error: mysql.h: No such file or directory # include "mysql.h" ^ compilation terminated. make[3]: *** [libzbxdb_a-db.o] Error 1 make[3]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs/zbxdb' make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory `/usr/local/src/zabbix-4.0.0/src/libs' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/zabbix-4.0.0/src' make: *** [install-recursive] Error 1
解决办法:(针对我的环境)
[root@Server01 zabbix-4.0.0]# ./configure --prefix=/usr/share/applications/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 [root@Server01 zabbix-4.0.0]# echo $? 0 [root@Server01 zabbix-4.0.0]# make install [root@Server01 zabbix-4.0.0]# echo $? 0