安装环境需要LAMP或者LNMP先搭建好
在此我使用上一篇搭建好的LNMP环境来安装zabbix
1.下载zabbix
http://www.zabbix.com/download.php
2.安装及配置
##先安装一下依赖
yum install net-snmp-devel libxml2-devel libcurl-devel
cd /usr/local/src
wget zabbix-2.4..tar.gz
tar zxvf zabbix-2.4..tar.gz
cd zabbix-2.4.
./configure --prefix=/usr/local/zabbix-2.4./ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
make
make install ##创建用户
groupadd zabbix
useradd -g zabbix zabbix ##zabbix server与proxy需要数据库,angent不需要。尤其要注意的是proxy只需要导入一个sql文件,而server一共要导入3个sql文件
cd database/mysql/
mysql -uroot -p
create database zabbix default charset utf8;
quit
mysql -uroot -pace826 zabbix < schema.sql
mysql -uroot -pace826 zabbix < images.sql
mysql -uroot -pace826 zabbix < data.sql ##配置zabbix相关文件
mkdir /etc/zabbix
cp conf/zabbix_server.conf /etc/zabbix/
vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=root
DBPassword=xxxxx
DBPort= ln -s /usr/local/src/mysql-5.6./libmysql/libmysqlclient.so. /usr/lib64 cd frontends/php/
mkdir /usr/local/nginx/html/zabbix
cp -rp ./* /usr/local/nginx/html/zabbix/ ##修改下php配置
vim /usr/local/php-5.6.25/lib/php.ini
max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time = 300
date.timezone = “Asia/Shanghai”
always_populate_raw_post_data = -1 vim /usr/local/zabbix-2.4.8/etc/zabbix_server.conf
DBName=zabbix
DBUser=root
DBPassword=xxxxx
DBPort=3306 reboot
/usr/local/nginx/sbin/nginx
/usr/local/php-5.6.25/sbin/php-fpm
/usr/local/zabbix-2.4.8/sbin/zabbix_server
3.打开浏览器安装