当前位置:   article > 正文

Ubuntu server 24 (Linux) 安装部署 Zabbix 7.0 LTS_ubuntu安装zabbix

ubuntu安装zabbix

一  安装Mysql 8.03

  1. test@test:~$ mysqld --version
  2. /usr/sbin/mysqld Ver 8.0.36-2ubuntu3 for Linux on x86_64 ((Ubuntu))
  3. #mysql 大于8.03.x ,启动zabbix-server会报错如下
  4. Unable to start Zabbix server due to unsupported MySQL database version (8.04.00).
  5. Must not be higher than (8.03.x).
  6. Use of supported database version is highly recommended.
  7. Override by setting AllowUnsupportedDBVersions=1 in Zabbix server configuration file at your own risk.

二  安装Zabbix

1 安装Zabbix repository

  1. wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu24.04_all.deb
  2. sudo dpkg -i zabbix-release_7.0-1+ubuntu24.04_all.deb
  3. sudo apt update

2 安装Zabbix server,Web前端,agent

sudo apt-get install zabbix-server-mysql zabbix-frontend-php  zabbix-sql-scripts zabbix-agent php8.3-fpm zabbix-nginx-conf

3 查看版本

  1. #test@test:~$ zabbix_agentd -V
  2. zabbix_agentd (daemon) (Zabbix) 7.0.0
  3. Revision 49955f1fb5c 3 June 2024, compilation time: Jun 3 2024 05:55:33
  4. Copyright (C) 2024 Zabbix SIA
  5. License AGPLv3: GNU Affero General Public License version 3 <https://www.gnu.org/licenses/>.
  6. This is free software: you are free to change and redistribute it according to
  7. the license. There is NO WARRANTY, to the extent permitted by law.
  8. This product includes software developed by the OpenSSL Project
  9. for use in the OpenSSL Toolkit (http://www.openssl.org/).
  10. Compiled with OpenSSL 3.0.13 30 Jan 2024
  11. Running with OpenSSL 3.0.13 30 Jan 2024
  12. #test@test:~$ zabbix_server -V
  13. zabbix_server (Zabbix) 7.0.0
  14. Revision 49955f1fb5c 3 June 2024, compilation time: Jun 3 2024 05:55:33
  15. Copyright (C) 2024 Zabbix SIA
  16. License AGPLv3: GNU Affero General Public License version 3 <https://www.gnu.org/licenses/>.
  17. This is free software: you are free to change and redistribute it according to
  18. the license. There is NO WARRANTY, to the extent permitted by law.
  19. This product includes software developed by the OpenSSL Project
  20. for use in the OpenSSL Toolkit (http://www.openssl.org/).
  21. Compiled with OpenSSL 3.0.13 30 Jan 2024
  22. Running with OpenSSL 3.0.13 30 Jan 2024

4  创建数据库和导入数据库

  1. #sudo mysql -uroot -p
  2. mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
  3. Query OK, 1 row affected (0.01 sec)
  4. mysql> create user zabbix@'%' IDENTIFIED WITH mysql_native_password BY '密码';
  5. Query OK, 0 rows affected (0.02 sec)
  6. mysql> grant all privileges on zabbix.* to zabbix@'%';
  7. Query OK, 0 rows affected (0.00 sec)
  8. mysql> set global log_bin_trust_function_creators = 1;
  9. Query OK, 0 rows affected, 1 warning (0.00 sec)
  10. mysql> quit
  11. #导入数据
  12. sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
  13. #
  14. mysql -uroot -p
  15. mysql> set global log_bin_trust_function_creators = 0;
  16. Query OK, 0 rows affected, 1 warning (0.00 sec)
  17. mysql> quit

5 Zabbix server配置数据库

  1. sudo vim /etc/zabbix/zabbix_server.conf
  2. # DBPassword= --> DBPassword="密码"

6 修改nginx 配置文件

  1. sudo vim /etc/nginx/conf.d/zabbix.conf
  2. # listen 8080; --> listen 80;
  3. # server_name example.com; --> server_name 192.168.50.1 example.com;

7 启动Zabbix server和agent 服务

  1. sudo systemctl restart zabbix-server zabbix-agent nginx php8.3-fpm
  2. sudo systemctl enable zabbix-server zabbix-agent nginx php8.3-fpm

8 访问web安装

三 登录配置(默认用户密码Admin:zabbix)

1 中文支持

  1. sudo apt-get install language-pack-zh-hant language-pack-zh-hans
  2. #
  3. reboot
  4. #上传windows 的字体,解决图形界面中文乱码问题
  5. cd /usr/share/zabbix/assets/fonts
  6. sudo cp graphfont.ttf graphfont.ttf_bak
  7. sudo mv /home/test/STSONG.TTF graphfont.ttf
  8. #重新启动服务
  9. sudo systemctl restart zabbix-server

2 修改默认密码

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/881731
推荐阅读
相关标签
  

闽ICP备14008679号