OpenEuler 部署zabbix
时间: 2024-05-17 13:08:22 浏览: 45
以下是在OpenEuler上部署Zabbix的步骤:
1. 安装必要的软件包:
```shell
sudo dnf install -y epel-release
sudo dnf install -y httpd mariadb mariadb-server php php-mysqlnd php-gd php-xml php-bcmath php-mbstring php-ldap php-xmlrpc php-ctype php-json php-session php-sockets php-gettext php-openssl php-zip
```
2. 启动并设置MariaDB服务:
```shell
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
```
3. 创建Zabbix数据库和用户:
```shell
sudo mysql -u root -p
CREATE DATABASE zabbix character set utf8 collate utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zbx@1234';
FLUSH PRIVILEGES;
EXIT;
```
4. 导入Zabbix数据库模板:
```shell
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | sudo mysql -u zabbix -p zabbix
```
5. 配置Zabbix服务器:
```shell
sudo vi /etc/zabbix/zabbix_server.conf
```
在文件中找到并修改以下行:
```
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zbx@1234
```
6. 启动并设置Zabbix服务器和代理:
```shell
sudo systemctl start zabbix-server
sudo systemctl enable zabbix-server
sudo systemctl start zabbix-agent
sudo systemctl enable zabbix-agent
```
7. 配置防火墙规则:
```shell
sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --add-port={10050/tcp,10051/tcp} --permanent
sudo firewall-cmd --reload
```
8. 配置Apache Web服务器:
```shell
sudo vi /etc/httpd/conf.d/zabbix.conf
```
在文件中找到并修改以下行:
```
php_value date.timezone Asia/Shanghai
```
9. 启动并设置Apache服务:
```shell
sudo systemctl start httpd
sudo systemctl enable httpd
```
10. 访问Zabbix Web界面:
在浏览器中输入服务器的IP地址或域名,然后按照安装向导进行配置。