centos6.3 安装zabbix2.2.0

首先确认下zabbix2.2.0的安装要求:


Required
PHP version 5.3.0
PHP option memory_limit 128M
PHP option post_max_size 16M
PHP option upload_max_filesize 2M
PHP option max_execution_time 300
PHP option max_input_time 300
PHP time zone
PHP databases support
PHP bcmath
PHP mbstring
PHP sockets
PHP gd 2.0
PHP gd PNG support
PHP gd JPEG support
PHP gd FreeType support
PHP libxml 2.6.15
PHP xmlwriter
PHP xmlreader
PHP ctype
PHP session
PHP session auto start off
PHP gettext


1、在已有的LAMP或者LNMP的基础上安装zabbix,安装一些依赖包:
    
 yum install httpd.x86_64 httpd-manual.x86_64 php-xml  php-mbstring mysql-server.x86_64 mysql.x86_64 php-mysql.x86_64 php.x86_64 php-bcmath.x86_64 php-gd.x86_64 mysql-devel.x86_64 curl-devel gcc.x86_64 libgcc.x86_64 make net-snmp.x86_64 net-snmp-devel.x86_64 net-snmp-utils.x86_64 wget ntp vim

2、添加用户:

groupadd zabbix
useradd zabbix -g zabbix

3、创建数据库,添加授权账号


create database zabbix character set utf8;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

4、编译安装zabbix

   下载地址:wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.0/zabbix-2.2.0.tar.gz
   
tar zxf zabbix-2.2.0.tar.gz
cd zabbix-2.2.0
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl
make install

5、导入数据库
    
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

6、修改配置文件
    
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

7、添加服务端口:

    
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

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访问好了后web登陆:http://ip/zabbix

确认每个Required都是ok的才会显示Next按钮,如果有Fail的需要完善系统要求

202316340.png

202320137.png

202323941.png

202326883.png

这里主要下,出现Fail的原因是zabbix的配置文件没有,需要点击“Download configuration file”将zabbix.conf.php下载到本地在上传到服务器的zabbix/conf/目录下,然后在web页面Retry即可

202329928.png

202332811.png

到此web页面配置完毕,已经到了登陆界面,zabbix的默认登陆账号是admin,密码是zabbix

202917804.png

10、更换中文字体,登陆后在页面的右上边点击“Prefile”

203239644.png

在Language选项中选择“Chinese(zh_CN)”,然后Save

203241369.png

11、如果出现有乱码,可以到window系统找到自己喜欢的字体上传上去

在windows系统中的c:\windows\fonts目录中copy一个自己喜欢的字体文出来,如msyh.ttf

将copy出来的字体上传到Zabbix根目录中的fonts目录下

将原来的字体文件“DejaVusSans.ttf”备份

将上传的字体文件如msyh.ttf改名为DejaVusSans.ttf

重新登录zabbix即可







你可能感兴趣的:(centos6.3,安装zabbix2.2.0)