1.安装一些依赖包
安装lamp环境
[root@localhost ~]#yum installmysql-server httpd php
其他依赖包
[root@localhost ~]#yum install mysql-devel net-snmp net-snmp-utils net-snmp-develcurl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml -gcc-c++
2.下载zabbix 解压并安装
[root@localhost ~]# tar zxf zabbix-2.0.14.tar
[root@localhost ~]# cd zabbix-2.0.14
[root@localhost zabbix-2.0.14]#./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy--enable-agent --with-mysql --with-libcurl --with-net-snmp
[root@localhost zabbix-2.0.14# makeinstall
3.启动mysql并导入数据
[root@localhost ~]# service mysqld start
[root@localhost zabbix-2.0.14]# mysql -u root -p
mysql> create database zabbixcharacter set utf8;
mysql> use zabbix
导入zabbix的表和数据:
mysql> source/root/zabbix-2.0.14/database/mysql/schema.sql
mysql> source /root/zabbix-2.0.14/database/mysql/images.sql
mysql> source /root/zabbix-2.0.14/database/mysql/data.sql
mysql> GRANT ALL PRIVILEGESON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbix' ;
4.配置php
[root@localhost zabbix-2.0.14]#groupadd zabbix
[root@localhost zabbix-2.0.14]#useradd -g zabbix zabbix
[root@localhost zabbix-2.0.14]# cd frontends/
[root@localhost frontends]# cp -rf php /var/www/html/zabbix
[root@localhost frontends]# cd/var/www/html
[root@localhost html]# chown -R zabbix.zabbix zabbix/
[root@localhost html]# vim /etc/php.ini
max_execution_time = 300 #最长执行时间
date.timezone = Asia/Shanghai #时区
post_max_size = 32M #最大上传限制
max_input_time = 300 #最大接收数据时间
5.在web页面
[root@localhost html]# service httpd start
[root@localhost html]# service iptables stop #关防火墙
在浏览器上输入http://your-IP/zabbix