1、选择安装zabbix服务器的平台
此处我们选择的是 zabbix 4.4 + centos 8 + MySQL + Apache
2、在平台上安装和配置zabbix服务
- 更新 Centos 8的软件包
dnf update -y
- 关闭SElinux
vim /etc/selinux/config# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:#enforcing - SELinux security policy is enforced.#permissive - SELinux prints warnings instead of enforcing.#disabled - No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of these three values:#targeted - Targeted processes are protected,#minimum - Modification of targeted policy. Only selected processes are protected. #mls - Multi Level Security protection.SELINUXTYPE=targeted
- adding zabbix repository
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpmdnf clean all
- 安装 zabbix server,web前端,agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent mariadb-server mairadb -y
- 启动 MySQL 、Apache 服务
systemctl start mairadb httpdsystemctl enable mariadb httpd
- 创建数据库密码
mysql -u rootupdate user set password = password("zabbixpasswd")where user = 'root';flush privileges;quit;或者使用 mysql_secure_installation 根据指引一步一步来 。
- 创建 zabbix 的数据库和用户
mysql -uroot -p zabbixpasswdmysql> create database zabbix character set utf8 collate utf8_bin;mysql> create user 'zabbix'@'localhost' identified by 'zabbixpasswd';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 数据库
vi /etc/zabbix/zabbix_server.confDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbixpasswd
- 修改 php.ini 的时区和参数
vim /etc/php.ini找到 date.timezonedate.timezone = Asia/Shanghai
- 修改web前端的时区或者php参数(参数可不调,此处略做tiao'z)
php_value[max_execution_time] = 600php_value[memory_limit] = 512Mphp_value[post_max_size] = 64Mphp_value[upload_max_filesize] = 200Mphp_value[max_input_time] = 300php_value[max_input_vars] = 10000; php_value[date.timezone] = Asia/Shanghai
- 启动 zabbix server and agent process
systemctl restart zabbix-server zabbix-agent httpd php-fpmsystemctl enable zabbix-server zabbix-agent httpd php-fpm
- 添加防火墙端口或者关闭防火墙(不安全)
添加端口:firewall-cmd --add-port={10050/tcp,10051/tcp} --permanentfirewall-cmd --add-service={http,https} --permanentsystemctl restart firewalld关闭防火墙:systemctl stop firewalld(临时)systemctl disable firewalld(永久)
- 因为安装Centos 8 选择的是英文版,要zabbix中文显示需要安装中文包
dnf install langpacks-zh_CN.noarch -y
- 通过浏览器访问zabbix进行最后的步骤完成确认,即可使用zabbix:
文章插图
Zabbix 4.4.6. © 2001–2020, Zabbix SIA
推荐阅读
- 新手篇 DEDE织梦网站安装+还原数据详细教程
- 服务器安装PHP网站的运行环境
- 安装ThinkPHP
- 二 ThinkPHP6开发博客实战入门,ThinkPHP6的安装与配置
- 服务器安装mysql8数据库,并供外界远程访问
- python安装
- MySQLAnemometer可视化工具安装
- Intel|Intel扩建厂房安装ASML下代最先进EUV光刻机:“2nm”工艺提前投产
- CentOS文字终端中文乱码处理办法
- 云服务器一般安装centos哪个版本