Zabbix安装
1.安装步骤
#安装zabbix 仓库
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
#安装zabbix 服务端和代理端
yum install zabbix-server-mysql zabbix-agent
#编辑配置文件/etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.
[zabbix-frontend]
enabled=1
#安装zabbix前端包
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl
#创建和初始化数据库
# 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配置数据库
#编辑配置文件
vim /etc/zabbix/zabbix_server.conf
DBPassword=password
#为Zabbix前端配置PHP
#编辑配置文件 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, uncomment and set the right timezone for you.
php_value[date.timezone] = Asia/Shanghai
#启动Zabbix server和agent进程
#启动Zabbix server和agent进程,并为它们设置开机自启:
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
#配置防火墙
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
#配置Zabbix前端
#连接到新安装的Zabbix前端:
http://server_ip_or_name/zabbix
2.常见问题处理
2.1解决图形中文显示乱码
解决Zabbix 5.0不能选择中文和中文乱码问题 - 不羁的罗恩 - 博客园
2.2解决队列的selinux问题
2.2.1、缘由
在安装zabbix的时候,按照官网的Zabbix Manual一路跑下来,zabbix的dashboard提示:zabbix server is not running the information displayed may not be current。后来google后关闭selinux,Zabbix服务正常。
因为:SELinux出于安全考虑,会阻止zabbix server的http通信端口10051。同时,如果zabbix要使用fping,需要设置相应规则。
2.2.2、解决办法:
关闭SELinux(为了省事,大多数人员这么选择)
查看SElinux状态:
1) sudo sestatus -v |grep status
SELinux status:enable
2) getenforce
关闭SELinux:
1)临时关闭(不需要重启机器):
setenforce 0
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
2)永久关闭,修改配置文件需要重启机器:
vim /etc/selinux/config
将SELINUX=enforceing 改为 SELINUX=disabled
重启机器即可。
配置SELinux规则
#SELinux规则的方法推荐
ausearch -c 'zabbix_server' --raw | audit2allow -M my-zabbixserver
semodule -i my-zabbixserver.pp
zabbix安装,关闭SELinux - Devops达人 - 博客园
Zabbix监控配置详解_little_baixb的博客-CSDN博客_页面监控
本文来自博客园,作者:C计划,转载请注明原文链接:https://www.cnblogs.com/WeeLad/p/16661951.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App