zabbix 的yum安装

#设置解析 注意:网络条件较好时,可以不用自建yum源

echo ‘10.0.0.1 mirrors.aliyuncs.com mirrors.aliyun.com repo.zabbix.com’ >> /etc/hosts

#安装zabbix源、aliyun YUM源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
curl -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/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

#安装zabbix
yum install -y zabbix-server-mysql zabbix-web-mysql

#安装启动 mariadb数据库

yum install -y mariadb-server
systemctl start mariadb.service

#创建数据库
mysql -e ‘create database zabbix character set utf8 collate utf8_bin;’
mysql -e ‘grant all privileges on zabbix.* to zabbix@localhost identified by “zabbix”;’

#导入数据
zcat /usr/share/doc/zabbix-server-mysql-3.0.13/create.sql.gz|mysql -uzabbix -pzabbix zabbix

#配置zabbixserver连接mysql
sed -i.ori ‘115a DBPassword=zabbix’ /etc/zabbix/zabbix_server.conf

#添加时区
sed -i.ori ‘18a php_value date.timezone Asia/Shanghai’ /etc/httpd/conf.d/zabbix.conf

#解决中文乱码
yum -y install wqy-microhei-fonts
\cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

#启动服务
systemctl start zabbix-server
systemctl start httpd

#写入开机自启动
chmod +x /etc/rc.d/rc.local
cat >>/etc/rc.d/rc.local<<EOF
systemctl start mariadb.service
systemctl start httpd
systemctl start zabbix-server
EOF

#输出信息
echo “浏览器访问 http://hostname -I|awk '{print $1}'/zabbix”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值