准备好Lamp环境开放80端口
yum install httpd php libcurl-devel net-snmp-devel gcc -y
安装mysql数据库我使用的rpm包安装
添加用户
groupadd zabbix
useradd zabbix -g zabbix
创建zabbix数据库,添加授权账号
create database zabbix character set utf8;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
编译安装zabbix
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.6/zabbix-2.4.6.tar.gz
tar –zxf zabbix-2.4.6.tar.gz
cd zabbix-2.4.6
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent \
--with-mysql --with-net-snmp --with-libcurl
make install
导入数据库
mysql -uroot -p666666 -hlocalhost zabbix < database/mysql/schema.sql
mysql -uroot -p666666 -hlocalhost zabbix < database/mysql/images.sql
mysql -uroot -p666666 -hlocalhost zabbix < database/mysql/data.sql
修改配置文件
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 /var/www/html/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/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
添加服务端口
cat >>/etc/services <<EOF
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
zabbix-trapper 10051/tcp Zabbix Trapper
zabbix-trapper 10051/udp Zabbix Trapper
EOF
启动服务
/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
将必须服务加入开机自启动
[root@localhost zabbix-2.4.6]# chkconfig httpd on
[root@localhost zabbix-2.4.6]# chkconfig mysql on
[root@localhost zabbix-2.4.6]# chkconfig zabbix_server on
web页面配置配置http访问好了后 web登录http://ip/zabbix
确认每个Required都是ok的才会显示Next按钮,如果有Fail的需要完善系统要求。
Finish完成
Zabbix默认登录账号admin密码zabbix
修改界面语音为中文简体
出图界面是方框问题解决。
从windows字体库拷贝一个中午字体上传到/var/www/html/zabbix/fonts
将原来字体备份mv DejaVuSans.ttf DejaVuSans.ttf.bak
# mv 替换zabbix字体.ttf DejaVuSans.ttf
重启zabbix 服务
service zabbix_server restart
本文参考链接:http://bguncle.blog.51cto.com/3184079/1330247/
屌炸天
不能炸了,还有用