Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2274567
  • 博文数量: 168
  • 博客积分: 6641
  • 博客等级: 准将
  • 技术积分: 1996
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-02 11:49
文章存档

2020年(4)

2019年(6)

2017年(1)

2016年(3)

2015年(3)

2014年(8)

2013年(2)

2012年(12)

2011年(19)

2010年(10)

2009年(3)

2008年(17)

2007年(80)

分类: LINUX

2019-12-08 18:26:26


zabbix 4.0监控平台快速部署

2019.12.07 TsengYia 
---- http://tsengyia.blog.chinaunix.net/ 

系统环境: 
    CentOS Linux release 7.5.1804 (Core)

软件环境:
    zabbix-agent-4.0.15-1.el7
    zabbix-server-mysql-4.0.15-1.el7
    zabbix-web.4.0.15-1.el7
    zabbix-web-mysql-4.0.15-1.el7
    fping-3.10-4.el7
    iksemel-1.4-6.sdl7

#################################################################

#!/bin/bash
# TsengYia 2019.12.07
# for CentOS 7.5 or RHEL 7.5 Server
# 1. 设置好软件源(比如国内阿里的镜像)
rm -rf /etc/yum.repos.d/*.repo #//清理其他可能有问题的源
wget -O /etc/yum.repos.d/CentOS-Base.repo
  #//下载阿里的CentOS 7源配置
yum-config-manager  --add 
  #//添加阿里的zabbix 4.0源配置
sed   '/gpgcheck/s/1/0/g'  /etc/yum.conf #//关闭GPG签名检查


# 2. 安装LAMP平台、依赖包
yum  -y  install  httpd  mariadb-server  mariadb  php  php-mysql
yum  -y  install 
yum  -y  install 


# 3. 安装zabbix,简单检查
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
if [ $(yum list installed | grep -c zabbix) -lt 4 ]
then
    echo "zabbix packages installation failed." >&2
    exit 2
fi


# 4. 数据库配置、初始化
systemctl  restart  mariadb ; systemctl  enable  mariadb
mysql  -uroot -e 'create database zabbix character set utf8 collate utf8_bin;'
mysql  -uroot -e 'grant all privileges on zabbix.* to zabbix@localhost identified by "password";'
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -ppassword zabbix


# 5. 配置、启动zabbix-server平台
sed -i '/timezone/{s/#//g;s#Europe/Riga#Asia/Shanghai#g}' /etc/httpd/conf.d/zabbix.conf
systemctl  restart  httpd ; systemctl  enable  httpd
sed -i '/DBPassword=/cDBPassword=password' /etc/zabbix/zabbix_server.conf
systemctl  restart  zabbix-server  zabbix-agent ; systemctl  enable  zabbix-server  zabbix-agent


# 6. 结果提示
echo '请访问 ,按照提示完成zabbix前端安装' 

#################################################################

阅读(737) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~