一、安装MySQL
yum install mysql-server -y
1. 启动mysql
/etc/init.d/mysqld start
2. chkconfig mysqld on
3. 更改登录默认字符集
# vim /etc/my.cnf
4. 检查字符集
5. 创建zabbix数据库,创建用户
create databases zabbix;
grant all on zabbix.* to [email protected] identified by "zabbix_pass";
6. 修改数据库信息
vim /etc/zabbix/zabbix_server.conf
DBName=zabbix 91行
DBUser=zabbix 107行
DBPassword=zabbix_pass 116行添加
DBSocket=/var/lib/mysql/mysql.sock 125行,数据库的连接方式
7. 导入zabbix表
查看需要导入的表
# rpm -ql zabbix-server-mysql|grep sql
/usr/sbin/zabbix_server_mysql
/usr/share/doc/zabbix-server-mysql-2.2.10
/usr/share/doc/zabbix-server-mysql-2.2.10/create
/usr/share/doc/zabbix-server-mysql-2.2.10/create/data.sql
/usr/share/doc/zabbix-server-mysql-2.2.10/create/images.sql
/usr/share/doc/zabbix-server-mysql-2.2.10/create/schema.sql
导入表
# mysql zabbix < /usr/share/doc/zabbix-server-mysql-2.2.10/create/schema.sql
# mysql zabbix < /usr/share/doc/zabbix-server-mysql-2.2.10/create/images.sql
# mysql zabbix < /usr/share/doc/zabbix-server-mysql-2.2.10/create/data.sql
8. 启动服务
# /etc/init.d/zabbix-server start
Starting Zabbix server: [确定]
# chkconfig zabbix-server on 开机自启动
9. 查看日志内容
# tail -f /var/log/zabbix/zabbix_server.log
二、在所有的服务器安装yum源
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
检查是否有此yum源
# ls /etc/yum.repos.d/zabbix.repo
/etc/yum.repos.d/zabbix.repo
三、安装zabbix server
yum install zabbix-server zabbix-server-mysql -y
四、安装zabbix web
yum install zabbix-web zabbix-web-mysql -y
五、更改时区
# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Chongqing 18行修改
六、启动httpd服务
# /etc/init.d/httpd start
# chkconfig httpd on
七、图形界面安装zabbix