代码拉取完成,页面将自动刷新
准备工作:
[root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core)
[root@localhost ~]# uname -r 3.10.0-862.14.4.el7.x86_64
#安装zabbix源、aliyun YUM源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
centos7:
rpm -ivh http://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
centos6:
rpm -ivh http://repo.zabbix.com/zabbix/4.2/rhel/6/x86_64/zabbix-release-4.2-1.el6.noarch.rpm
#安装zabbix
yum install -y zabbix-server-mysql zabbix-web-mysql
#安装启动 mariadb数据库 不需要,已经安装mysql
# yum install -y mariadb-server
# systemctl start mariadb.service
# 创建zabbix数据库
mysql -e 'create database zabbix character set utf8mb4 collate utf8mb4_general_ci' -uroot -p
# 创建 zabbix用户
/usr/local/mysql/bin/mysql -e 'grant all privileges on zabbix.* to zabbix@localhost identified by "zabbix" ' -uroot -p
# 导入数据
zcat /usr/share/doc/zabbix-server-mysql-4.2.1/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 mysqld
systemctl start httpd
systemctl start zabbix-server
EOF
#输出信息
echo "浏览器访问 http://`hostname -I|awk '{print $1}'`/zabbix"
agent下载地址:
http://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-agent-4.2.1-1.el7.x86_64.rpm
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。