码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS 7下安装部署Zabbix3.4

时间:2018-03-25 14:28:22      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:zabbix   zabbix3.4   centos7   

Zabbix安装:

环境:

系统环境:CentOS 7
Zabbix版本:Zabbix 3.4

安装步骤:

  1. 关闭防火墙和SELINUX
    systemctl stop firewalld && setenforce 0
  2. 安装zabbix相关软件包
    rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm &&\
    yum install zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mariadb-server mariadb zabbix-agent -y
  3. 修改PHP时区配置
    sed -i ‘s@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g‘ /etc/httpd/conf.d/zabbix.conf
  4. 启动数据库
    systemctl start mariadb
  5. 创建zabbix所用的数据库及用户
    mysql
    create database zabbix character set utf8 collate utf8_bin;
    grant all on zabbix.* to zabbix@‘localhost‘ identified by ‘123456‘;
    exit
    cd /usr/share/doc/zabbix-server-mysql-3.4.7/ &&\
    zcat create.sql.gz|mysql -uzabbix -p123456 zabbix
  6. 修改zabbix配置文件
    vim /etc/zabbix/zabbix_server.conf
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=123456
    或者使用以下命令替换:
    sed -i ‘s@# DBHost=localhost@DBHost=localhost@g‘ /etc/zabbix/zabbix_server.conf &&\
    sed -i ‘s@# DBPassword=@DBPassword=123456@g‘ /etc/zabbix/zabbix_server.conf
  7. 启动zabbix
    systemctl start zabbix-server &&\
    systemctl start httpd

安装Zabbix脚本:

systemctl stop firewalld && setenforce 0 &&\
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm &&\
yum install zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mariadb-server mariadb zabbix-agent -y &&\
sed -i ‘s@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g‘ /etc/httpd/conf.d/zabbix.conf &&\
systemctl start mariadb &&\
mysql
create database zabbix character set utf8 collate utf8_bin;
grant all on zabbix.* to zabbix@‘localhost‘ identified by ‘123456‘;
exit
cd /usr/share/doc/zabbix-server-mysql-3.4.7/ &&\
zcat create.sql.gz|mysql -uzabbix -p123456 zabbix &&\
sed -i ‘s@# DBHost=localhost@DBHost=localhost@g‘ /etc/zabbix/zabbix_server.conf &&\
sed -i ‘s@# DBPassword=@DBPassword=123456@g‘ /etc/zabbix/zabbix_server.conf &&\
systemctl start zabbix-server &&\
systemctl start httpd

CentOS 7下安装部署Zabbix3.4

标签:zabbix   zabbix3.4   centos7   

原文地址:http://blog.51cto.com/ilctc/2090851

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!