Ubuntu 22.04.1安装Zabbix6.4

DevOps Zabbix评论6,533字数 3085阅读10分17秒阅读模式

Install Zabbix repository

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

安装Zabbix server,Web前端,agent

sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent mysql-server

创建初始数据库

mysql_secure_installation
创建数据库
root@i-o1ms6u18:~# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.35-0ubuntu0.22.04.1 (Ubuntu)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.00 sec)

mysql> create user zabbix@localhost identified by 'password';
Query OK, 0 rows affected (0.01 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> quit;
Bye

导入初始架构和数据,系统将提示您输入新创建的密码。

root@i-o1ms6u18:~# 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.

root@i-o1ms6u18:~# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.35-0ubuntu0.22.04.1 (Ubuntu)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set global log_bin_trust_function_creators = 0;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> quit;
Bye
d. 为Zabbix server配置数据库

编辑配置文件 /etc/zabbix/zabbix_server.conf

root@i-o1ms6u18:~# vim /etc/zabbix/zabbix_server.conf
DBPassword=password
为Zabbix前端配置PHP

编辑配置文件 /etc/zabbix/nginx.conf uncomment and set 'listen' and 'server_name' directives.

root@i-o1ms6u18:~# vim /etc/zabbix/nginx.conf
 listen 80;
server_name 139.198.34.146;
启动Zabbix server和agent进程

启动Zabbix server和agent进程,并为它们设置开机自启:

root@i-o1ms6u18:~# systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm
root@i-o1ms6u18:~# systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm
Synchronizing state of zabbix-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-server
Synchronizing state of zabbix-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-agent
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
Synchronizing state of php8.1-fpm.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable php8.1-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /lib/systemd/system/zabbix-server.service.

Ubuntu 22.04.1安装Zabbix6.4

继续阅读
DevOps
  • 本文由 发表于 2023年11月10日 15:07:32
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
zabbix5.0服务端安装字体 Zabbix

zabbix5.0服务端安装字体

打开图形页面有乱码 安装字体 [root@ip-10-1-9-117 ~]# yum install wqy-microhei-fonts -y 修改字体链接,链接到新安装的字体 [roo...
评论  0  访客  0

发表评论