安装zabbix所需的服务
1.安装httpd
yum install httpd
2.安装php
zabbix3.0需要php版本在5.4以上,所以需要添加epel和remi源。
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
安装 PHP及相关扩展
yum --enablerepo=remi,remi-php55 install php php-fpm php-common php-devel php-mysqlnd php-mbstring php-mcrypt yum --enablerepo=remi,remi-php55 install php-gd-* php-bcmath php-xml
修改php.ini参数
vim /etc/php.ini post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = Asia/Shanghai
3.安装数据库
wget http://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm rpm -ivh mysql57-community-release-el6-9.noarch.rpm yum install mysql-server mysql-devel -y /etc/init.d/mysqld restart
创建数据库和用户
mysql -uroot -e "create database zabbix CHARACTER SET = utf8;" mysql -uroot -e "grant all on zabbix.* to zabbix@'localhost' identified by 'zabbix'; flush privileges;"
安装zabbix
1.安装官方yum源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
2.安装zabbix服务端和agent端
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
3.设置zabbix,导入数据
cd /usr/share/doc/zabbix-server-mysql-3.0.3/ zcat create.sql.gz | mysql -uroot zabbix
4.设置数据库用户名和密码
vi /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix
5.设置时区
cp /usr/share/doc/zabbix-web-3.0.3/httpd22-example.conf /etc/httpd/conf.d/ vim /etc/httpd/conf.d/httpd22-example.conf php_value date.timezone Asia/Shanghai
6.重启httpd
service httpd restart
7.图形乱码设置中文
rm /etc/alternatives/zabbix-web-font /usr/share/zabbix/fonts/graphfont.ttf -f ln -s /usr/share/fonts/dejavu/SIMHEI.TTF /etc/alternatives/zabbix-web-font ln -s /etc/alternatives/zabbix-web-font /usr/share/zabbix/fonts/graphfont.ttf /etc/init.d/zabbix-server start
client配置文件
1.设置客户端
vim /etc/zabbix/zabbix_agentd.conf Server=10.16.1.202
2.启动客户端
service zabbix-agent restart
输入服务端IP和zabbix就可以进行web界面安装了。
http://IP/zabbix
WEB界面安装
111