ubuntu22.04zabbix搭建及配置

该文详细描述了在Ubuntu22.04系统上安装和配置Zabbix6.0LTS监控系统的过程,包括更新系统、安装MySQL8.0、Apachewebserver,以及创建Zabbix数据库和用户,导入Zabbix服务器和前端,最后启动Zabbix服务并访问Web界面。
摘要由CSDN通过智能技术生成

操作系统:Ubuntu22.04.02LTS zabbix版本:6.0LTS mysql版本:8.0.33,webserver:apache

1、更新系统 apt-get update 、apt-get upgrade

2、安装mysql。apt-get install mysql-server、apt-get install mysql-client、apt-get install libmysqlclient-dev

检查安装是否成功apt-get install net-tools,netstat -tap | grep mysql

mysql安装后,初始修改root密码 mysql -u root -p ,use mysql; update user set password =password('123456') where user ='root' and host='localhost'; flush privileges;

设置数据库开机自启动systemctl enable mysqld.server

3、安装Apache2:apt-get install apache2;

4、安装zabbix服务器,完全按照zabbix给出
来的方案。zabbix官网下载页面有安装说明

Download and install Zabbix 6.0 LTS for Ubuntu 22.04 (Jammy) Server, Frontend, Agent, MySQL, Apachehttps://www.zabbix.com/download?zabbix=6.0&os_distribution=ubuntu&os_version=22.04&components=server_frontend_agent&db=mysql&ws=apache

 a. Install Zabbix repository

Documentation

# wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb
# dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb
# apt update

b. Install Zabbix server, frontend, agent

# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

c. Create initial database

Documentation

Make sure you have database server up and running.

Run the following on your database host.

# mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;

On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password.

# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Disable log_bin_trust_function_creators option after importing database schema.

# mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

d. Configure the database for Zabbix server

Edit file /etc/zabbix/zabbix_server.conf

DBPassword=password

e. Start Zabbix server and agent processes

Start Zabbix server and agent processes and make it start at system boot.

# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2

f. Open Zabbix UI web page

The default URL for Zabbix UI when using Apache web server is http://host/zabbix

注意事项:mysql数据库错误的话需要反复重新配置,用命令删除database操作等等。

最后,zabbix的默认账号Admin,初始密码zabbix。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值