首页 > 代码库 > zabbix的基本安装

zabbix的基本安装

zabbix的yum安装

zabbix的主页:http://www.zabbix.com/
 
zabbix server端:
安装zabbix的yum源
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm

yum安装安装zabbix及相关应用

yum install zabbix-server-mysql zabbix-web-mysql -y

安装zabbix-agent

yum install zabbix-agent

安装MySQL

yum install -y mysql-server mysql

创建数据库使用utf8字符集

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf 
vim /etc/my.cnf 
[mysqld]
插入一下内容
character-set-server = utf8
init-connect = ‘SET NAMES utf8‘
collation-server = utf8_general_ci

mysql创建表,授权zabbix用户

chkconfig mysqld on
service mysqld start
shell> mysql -uroot -p<password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix‘;
mysql> quit;

 

导入基础的表数据

cd /usr/share/doc/zabbix-server-mysql-2.4.8/create
mysql -uroot zabbix < schema.sql
mysql -uroot zabbix < images.sql
mysql -uroot zabbix < data.sql

编辑zabbix-server的http时区

cd /etc/httpd/conf.d/
vim zabbix.conf
修改为以下内容
php_value date.timezone Asia/Shanghai

编辑zabbix-server配置文件

vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

启动zabbix-server

service zabbix-server start
service httpd start
service zabbix-agent start
chkconfig httpd on
chkconfig zabbix-server on
chkconfig zabbix-agent on

 

zabbix的基本安装