Centos + Zabbix

1 安装ZABBIX

# rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-X.X-X.elX.noarch.rpm
(Example: rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm) 

2 安装mysql数据库

# yum install zabbix-server-mysql zabbix-web-mysql

3 安装ZABBIX代理

# yum install zabbix-agent

4 创建初始数据库

在MYSQL上创建数据库和用户
# mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> exit
  导入初始数据库
  # cd /usr/share/doc/zabbix-server-mysql-2.2.0/create
  # mysql -uroot zabbix < schema.sql
  # mysql -uroot zabbix < images.sql
  # mysql -uroot zabbix < data.sql
  

5 启动ZABBIX服务

 
 在zabbix_server.conf编辑数据库设置
 # vi /etc/zabbix/zabbix_server.conf
   DBHost=localhost
   DBName=zabbix
   DBUser=zabbix
   DBPassword=zabbix
 启动zabbix服务器
 # service zabbix-server start

6 zabbix PHP网页配置

# vi  /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
# php_value date.timezone Europe/Riga 

设置php的时区与系统一样
# vi /etc/php.ini
date.timezone = Asia/Shanghai 

7 启动服务

 service httpd start
 service zabbix-agent start
 service zabbix-server start
 service mysqld start
 

8 网页访问

关掉防火墙或服务器开放10050/10051端口 
iptables -A INPUT -p tcp --dport 10050 -j ACCEPT
iptables -A INPUT -p tcp --dport 10051 -j ACCEPT
service iptables save
http://zabbixserverip:zabbix 一步一步设置,默认管理用户名:Admin 密码:zabbix