1、先安装lnmp这里就不讲了
2、安装必要组件
yum -y install mysql-devel libcurl-devel net-snmp-devel
3、添加用户
groupadd zabbix
useradd zabbix -g zabbix
4、建数据库
create database zabbix character set utf8;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
5、安装编译zabbix
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.7/zabbix-2.2.7.tar.gz
tar zxvf zabbix-2.2.7.tar.gz
cd zabbix-2.2.7
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent \
--with-mysql --with-net-snmp --with-libcurl
make install
6、导入数据库
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/schema.sql
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/images.sql
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/data.sql
7、修改配置文件
cp misc/init.d/fedora/core/zabbix_server /etc/init.d/
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
cp -R frontends/php /home/wwwroot/default/zabbix #这个目录根据自己网站目录调整
sed -i 's/^DBUser=.*$/DBUser=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf #数据库用户名
sed -i 's/^.*DBPassword=.*$/DBPassword=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf #数据库密码
sed -i 's/# DBSocket=\/tmp\/mysql.sock/DBSocket=\/tmp\/mysql.sock/g' /usr/local/zabbix/etc/zabbix_server.conf
sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/init.d/zabbix_server
sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/init.d/zabbix_agentd
8、启动服务
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start
echo "/etc/init.d/zabbix_server start" >> /etc/rc.local
echo "/etc/init.d/zabbix_agentd start" >> /etc/rc.local
9、安装web端,访问http://ip/zabbix
把C:/Windows/Fonts/simkai.ttf(下面有下载连接) 上传到zabbix的fonts目录
# cd /home/wwwroot/default/zabbix/ # 我zabbix安装目录 # sed -i 's/DejaVuSans/simkai/g' ./include/defines.inc.php