基于Red Hat系统工具包存在两种方式之一:RPM包
centos7 安装Mariadb
centos7 安装php7.2
Centos7 安装部署zabbix5.0服务端和客户端
centos7 安装部署 zabbix5.0 (超详细)
centos7安装部署zabbix5.0
Zabbix 5.0 LTS 版本安装
Centos7下搭建zabbix5.0环境(一)
Centos7下搭建zabbix5.0环境(二)
zabbix邮箱报警设置&问题汇总
Centos7更换yum源为阿里源
centos7配置阿里云yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
安装zabbix服务端
- 实验环境:192.168.11.1 server端ip,LAMP环境(php要求7.2版本),aliyun源,selinux=disabled,firewalld关掉,数据库名:zabbix,用户名:zabbix,密码:zabbix,把zabbix数据库的全部权限授权给zabbix用户
- 192.168.11.2 agent1ip,安装zabbix-agent,aliyun源
server端步骤:
1. yum -y install httpd --安装httpd
2. yum -y install mariadb mariadb-server --安装mariadb,mariadb-server
3. rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm --配置php的源
3.1 yum install php72w-fpm php72w-opcache php72w-cli php72w-pecl php72w-pear php72w-devel --安装php及依赖
4. systemctl enable httpd mariadb --now --启动并自启
5. mysql_secure_installation --设定root的密码
6. mysql -u root -p 用root进去后创建数据库名:zabbix,用户名:zabbix,密码:zabbix,把zabbix数据库的全部权限授权给zabbix用户
6.1 create database zabbix character set utf8 collate utf8_bin; --创建utf-8格式的名为zabbix的数据库
6.2 create user zabbix@localhost identified by 'zabbix'; --创建密码为zabbix的zabbix用户
6.3 grant all privileges on zabbix.* to zabbix@localhost; --把zabbix下的所有表授权给zabbix用户
7. rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
7.1 sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
8. yum -y install centos-release-scl
9. yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y
10. zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix -Dzabbix
11. vim /etc/zabbix/zabbix_server.conf
11.1 把里面的内容修改为对应的上面设定的。DBUser=zabbix,DBName=zabbix,BDPassword=zabbix
12. vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
12.1 把注释去掉,修改成这个,php_value[date.timezone] = Asia/Shanghai
13. systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
14. systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm --now
14.1 浏览器输入server端ip:192.168.11.1/zabbix 进入zabbix配置页面
15. yum -y install wqy-microhei-fonts
16. cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
17. 刷新网页中文不乱码了
agent端配置:
1. wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
2. rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
3. yum install zabbix-agent
4. 编辑Zabbix Agent 配置文件
vim /etc/zabbix/zabbix_agentd.conf
Server=[zabbix server ip]
ServerActive=[zabbix server ip]
Hostname=[ Hostname of client system ] 例如:agent1
5. systemctl enable zabbix-agent --now