centos 安装 zabbix 教程
时间: 2023-04-04 15:04:45 浏览: 247
您好,以下是 CentOS 安装 Zabbix 的教程:
1. 首先,您需要安装 EPEL 和 Zabbix 的官方仓库。您可以使用以下命令安装:
sudo yum install epel-release -y
sudo rpm -ivh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
2. 安装 Zabbix Server 和 Zabbix Agent。您可以使用以下命令安装:
sudo yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
3. 创建 Zabbix 数据库和用户。您可以使用以下命令创建:
sudo mysql -uroot -p
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
quit;
4. 导入 Zabbix 数据库模板。您可以使用以下命令导入:
sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
5. 配置 Zabbix Server。您需要编辑 /etc/zabbix/zabbix_server.conf 文件,将以下行取消注释并修改:
DBPassword=password
6. 配置 Zabbix Agent。您需要编辑 /etc/zabbix/zabbix_agentd.conf 文件,将以下行取消注释并修改:
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
7. 启动 Zabbix Server 和 Zabbix Agent。您可以使用以下命令启动:
sudo systemctl start zabbix-server zabbix-agent
sudo systemctl enable zabbix-server zabbix-agent
8. 配置防火墙。您需要允许 Zabbix Server 和 Zabbix Agent 的端口。您可以使用以下命令配置:
sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --permanent --add-port=10051/tcp
sudo firewall-cmd --reload
9. 访问 Zabbix Web 界面。您可以在浏览器中输入服务器的 IP 地址或域名,然后输入用户名和密码登录。
以上就是 CentOS 安装 Zabbix 的教程,希望对您有所帮助。
阅读全文
相关推荐
















