CentOS8下Zabbix6.0的安装使用
1.安装zabbix repository
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
dnf clean all
2.安装zabbix server,Web前端,agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
3.创建初始化数据库
3.1安装数据库
yum -y install https://repo.mysql.com//mysql80-community-release-el7-5.noarch.rpm
yum module disable mysql
yum -y install mysql-community-server mysql-community-devel
vi /etc/my.cnf
[mysqld] skip-grant-tables
datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid default_authentication_plugin=mysql_native_password
systemctl restart mysqld
3.2登录数据库
create database zabbix character set utf8mb4 collate utf8mb4_bin;
set global read_only=0;
flush privileges;
create user zabbix@'%' identified with mysql_native_password by 'Admin@123!';
grant all privileges on zabbix.* to zabbix@'%';
flush privileges;
quit;
3.3执行以下命令,会提示输入密码
zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
4.配置数据库
vi /etc/zabbix/zabbix_server.conf
配置以下内容:
DBPassword=Admin@123!
5.配置前端PHP
vi /etc/nginx/conf.d/zabbix.conf
listen 80;
server_name localhost;
vi /etc/nginx/nginx.conf
include /etc/nginx/conf.d/*.conf;
6.拷贝zabbix前端网页
cd /usr/share/zabbix
cp -a * /usr/share/nginx/html/
chmod -R 777 /usr/share/nginx/html/
7.修改php配置文件
vi /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
8.启动zabbix server和agent并设置开机自启
systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm
9.配置数据库连接
浏览器输入IP
10.使用
进入登陆页面,默认用户/密码为Admin/zabbix