1、安装 mysql80 community
2、安装zabbix
机器A:server,frontend,agent
Download and install ZabbixZabbix is being downloaded over 4 000 000 times every year for a reason. Download and install Zabbix for free and try it yourself!https://www.zabbix.com/download?zabbix=5.0&os_distribution=centos&os_version=7&components=agent&db=&ws=
3、zabbix-server连接数据库时,数据库密码不允许特殊字符
查看完整的初始密码规则
show variables like 'validate_password%';
修改规则
set global validate_password.policy=0;
set global validate_password.length=1;
4、zabbix-server启动失败
connection to database 'zabbix' failed: [2059] Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
mysql8.0密码加密方式默认为caching_sha2_password,zabbix-server不支持。
查看加密方式:
mysql> show variables like 'default_authentication_plugin';
+-------------------------------+-----------------------+
| Variable_name | Value |
+-------------------------------+-----------------------+
| default_authentication_plugin | caching_sha2_password |
+-------------------------------+-----------------------+
查看本地mysql用户的信息
mysql> select host,user,plugin from mysql.user;
+-----------+------------------+-----------------------+
| host | user | plugin |
+-----------+------------------+-----------------------+
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | mysql_native_password |
| localhost | zabbix | caching_sha2_password |
+-----------+------------------+-----------------------+
修改zabbix用户加密方式
mysql> ALTER USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root_password';
mysql> select host,user,plugin from mysql.user;
+-----------+------------------+-----------------------+
| host | user | plugin |
+-----------+------------------+-----------------------+
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | mysql_native_password |
| localhost | zabbix | mysql_native_password |
+-----------+------------------+-----------------------+
5、zabbix-server启动失败
cannot start preprocessing service: Cannot bind socket to "/var/run/zabbix/zabbix_server_preprocessing.sock": [13] Permission denied.
关闭防火墙、禁用SELinux
systemctl stop firewalld
setenforce 0
6、访问 http://ip 显示nginx默认页
方法一,默认的nginx配置,删除server部分,使用nginx/conf.d/zabbix.conf的server配置
# vi /etc/opt/rh/rh-nginx116/nginx/nginx.conf
方法二,修改nginx/conf.d/zabbix.conf中的默认监听端口80
# vi /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
listen 8080;
7、zabbix快速入门
添加主机和监控项
5. 快速入门 (zabbix.com)https://www.zabbix.com/documentation/5.0/zh/manual/quickstart