- 挂载光盘,配置yum 源
- 建目录
#mkdir /mnt/rhel84
- 上传光盘镜像
/root/rhel-8.4-x86_64-dvd.iso
- 编辑/etc/fstab文件,新增一行
/root/rhel-8.4-x86_64-dvd.iso /mnt/rhel84 iso9660 loop 0 0
- 编辑/etc/yum.repos.d/local.repo
[LocalRepo_BaseOS]
name=LocalRepository_BaseOS
baseurl=file:///mnt/rhel84/BaseOS
enabled=1
gpgcheck=0
[LocalRepo_AppStream]
name=LocalRepository_AppStream
baseurl=file:///mnt/rhel84/AppStream
enabled=1
gpgcheck=0
[root@localhost yum.repos.d]#
- 安装zabbix repository
# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
- 执行
yum clean all
yum makecache
- 安装配置ZABBIX SERVER
- 依次执行:
# yum install zabbix-server-mysql zabbix-agent
# yum install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel net-snmp-devel libevent-devel curl-devel libxml2-devel pcre* -y
# yum install net-snmp net-snmp-utils –y
- 安装mariadb
# yum install mariadb mariadb-server
# systemctl start mariadb.service
# systemctl enable mariadb.service
# mysql_secure_installation
- 配置mariadb
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
- 为Zabbix server配置数据库
编辑配置文件 /etc/zabbix/zabbix_server.conf
DBPassword=password
- 为Zabbix前端配置PHP
/etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = "Asia/Shanghai"
- 启动Zabbix server和agent进程
# systemctl restart zabbix-server zabbix-agent httpd php-fpm
# systemctl enable zabbix-server zabbix-agent httpd php-fpm
- 配置Zabbix前端
连接到新安装的Zabbix前端: http://server_ip_or_name/zabbix
- 开始使用Zabbix