I. Environmental description
Ubuntu 14.06
zabbix-2.4.5
mysql-5.5
Second, compile and install the steps
1. System Update
sudo sudo apt-get upgrade
2. Install MySQL
sudo Install mysql-server mysql-client
3. Configure MySQL Parameters
Max_connections query_cache_limit = 1mquery_cache_size = 128mmax_ Heap_table_size = 256minnodb_lock_wait_timeout=innodb_buffer_pool_size =3000minnodb_flush_method=o_direct
4. Get zabbix-2.4.5 installation package
wget http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix_2.4.5.orig.tar.gz sudotar -zxvf zabbix_2. 4.5. orig.tar. gz-c/usr/local/src//usr/local/src/zabbix-2.4. 5/database
5. mysql Database initialization
Mysql-uroot-p-E"Create database Zabbix; " -uroot-p-E"grant all privileges in zabbix.* to [email protected] identified by ' Zabbix '; " -D Zabbix-uzabbix-pzabbix < Schema.sql
6. Test whether the database is initialized successfully
sudo-uzabbix-Pzabbix>>show databases; >> useZabbix; >>show tables; >>quit
7. Zabbix Compiled dependent package installation
8. Zabbix Compile and install
CD ... /configure--prefix=/usr/local/zabbix--enable-server--enable-agent--enable-proxy--with-mysql--WITH-NET-SNMP-- with-libcurlsudo make &&sudomakeinstall
9. Modify the Zabbix_proxy.conf file
cd/usr/local/zabbix/etc/sudo CP-a zabbix_proxy.conf zabbix_proxy.conf.baksudoVim zabbix_proxy.conf# Change the content server=192.168.45.126 IP Address of the #zabbix serverHostname=10.8.16.177 #本机的主机名, must be consistent with Zabbix server front-endLogFile=/tmp/zabbix_proxy.loglogfilesize=0Pidfile=/tmp/Zabbix_proxy.piddbhost=127.0.0.1DBName=Zabbixdbuser=Zabbixdbpassword=Zabbixdbsocket=/var/run/mysqld/mysqld.sock
10. Note whether the communication port between intranet and extranet is open, the 10051 default port of Zabbix proxy
11. Start Zabbix Proxy Service
sudo /usr/local/zabbix/sbin/zabbix_proxy-c/usr/local/zabbix/etc/zabbix_proxy.conf
12, Installation completed
PS: The installation process is also more tortuous, not because the installation of Zabbix proxy how complex, but in the installation of want to lazy, direct use of zabbix-proxy-mysql_2.4.5-1+trusty_amd64.deb such as the Deb installation package, Installation process because of the dependence of the problem LIBSNMP15 always error, looking for a variety of solutions to the Ubuntu 14.04 source, still can not be a more thorough solution. The following is attached Zabbix proxy installation script, look forward to your solution ~ ~ If the great God can solve, please also timely inform, thank you ~ ~
#!/bin/bash# define. Proxy_hostname must is external IP, match with nameinchzabbix-Server db. Proxy_hostname="192.168.146.224"zabbix_server_ip="192.168.146.238"mysql_passwd="Root"#1.InstallMysql,mysql-client mysql-server-5.5Apt-Get Updateapt-get-o dpkg::options::="--force-confold" Installmysql-client-5.5-Y--force-yes#2. Init proxy dbzabbix_dbname="Zabbix_proxy"Zabbix_dbuser="Zabbix_proxy"Zabbix_dbpassword="Zabbix_proxy_password"Mkdir-p/var/run/mysqld
if[-Z"$MYSQL _passwd"]; Then #Echo "STRING is empty"MySQL-uroot-e"DROP database IF EXISTS ${zabbix_dbname};create database ${zabbix_dbname} character set UTF8 collate utf8_bin;"MySQL-uroot-e"GRANT all on ${zabbix_dbname}.* to ' ${zabbix_dbuser} ' @ ' 127.0.0.1 ' identified by ' ${zabbix_dbpassword} ';"fiif[-N"$MYSQL _passwd"]; Then #Echo "STRING is not empty"MySQL-uroot-p$mysql_passwd-e"DROP database IF EXISTS ${zabbix_dbname};create database ${zabbix_dbname} character set UTF8 collate utf8_bin;"MySQL-uroot-p$mysql_passwd-e"GRANT all on ${zabbix_dbname}.* to ' ${zabbix_dbuser} ' @ ' 127.0.0.1 ' identified by ' ${zabbix_dbpassword} ';"fi#3.Installaddgroup zabbix;adduser zabbixapt-getInstallLIBIODBC2 Libopenipmi0LIBSNMP15libssh2-1Fping Dbconfig-common libcurl3-gnutls-y--force-yesapt-get-fInstall-Y--force-yes#auto config deb; fix debconfig bug.apt-getInstallDebconf-utils-y--force-Yessed-I.'347s/.*/#if \[\ "$dbc _install\"! = "true" \]; then return 0; fi/g'/usr/share/dbconfig-common/dpkg/CommonCat<<preseed |sudodebconf-set-Selectionszabbix-proxy-mysql zabbix-proxy-mysql/dbconfig-InstallBooleanfalseZabbix-proxy-mysql Zabbix-proxy-mysql/internal/skip-preseed Booleantruepreseeddpkg-I.Zabbix-proxy-mysql_2.4.5-1+trusty_amd64.debmkdir-p/var/run/Zabbixmkdir-p/var/log/zabbix/ChownZabbix:zabbix/var/run/zabbix-RChownZabbix:zabbix/etc/zabbix-RChownzabbix:zabbix/var/log/zabbix/-r#4. Import DB Shcemamysql-u${zabbix_dbuser}-p${zabbix_dbpassword}-h127.0.0.1${zabbix_dbname}</usr/share/zabbix-proxy-mysql/schema.sql#5. Update ConfigfileProxy_config_file=/etc/zabbix/zabbix_proxy.confsed-I.'s/^server=127.0.0.1$/server='${ZABBIX_SERVER_IP}'/g'${proxy_config_file}sed-I.'S/^hostname=zabbix proxy$/hostname='${proxy_hostname}'/g'${proxy_config_file}sed-I.'s/^dbhost=localhost$/dbhost=127.0.0.1/g'${proxy_config_file}sed-I.'s/^dbname=_proxy$/dbname='${zabbix_dbname}'/g'${proxy_config_file}sed-I.'s/^dbuser=zabbix$/dbuser='${zabbix_dbuser}'/g'${proxy_config_file}sed-I.'s/^dbpassword=$/dbpassword='${zabbix_dbpassword}'/g'${proxy_config_file}#6Restartservice Zabbix-proxy restart
ubuntu14.04 Install manual compile Zabbix Proxy