zabbix5.0 安装

本文详细介绍了如何在Ubuntu20.04系统上安装Zabbix5.0,包括安装Zabbix仓库、服务器、前端和代理,创建初始数据库,配置数据库和PHP,启动服务进程。此外,还解决了安装后无法设置中文以及设置中文后仍然出现乱码的问题,通过安装中文语言包和替换字体来实现正常显示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

zabbix5.0 安装

系统环境

Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

Install Zabbix repository

# wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
# sudo dpkg -i zabbix-release_5.0-1+focal_all.deb
# sudo apt update

Install Zabbix server, frontend, agent

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

Create initial database

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 utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;

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

# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Configure the database for Zabbix server

Edit file /etc/zabbix/zabbix_server.conf

# 如果数据库没有安装在本机,需要指定 ip 地址
DBHost=host
DBPassword=password
# 如果数据库没有增加 zabbix 用户,需要单独设置用户名和密码
DBUser=user

Configure PHP for Zabbix frontend

Edit file /etc/zabb ix/apache.conf, uncomment and set the right timezone for you.

# php_value date.timezone Europe/Riga 修改为
php_value date.timezone Asia/Shanghai

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

Configure Zabbix frontend

Connect to your newly installed Zabbix frontend: http://server_ip_or_name/zabbix Follow steps described in Zabbix documentation: Installing frontend

安装后无法设置中文

// 安装中文语言包
# sudo apt-get install language-pack-zh-hant language-pack-zh-hans

设置中文后仍然乱码

将 window 操作系统的字体上传到 zabbix web 所在服务器(上传 .ttf 文件),这里我们选择楷体 simkai.ttf

上传文件到 /usr/share/zabbix/assets/fonts 目录下,然后替换字体

[root@yinzhengjie.org.cn /usr/share/zabbix/assets/fonts]# sed -r -i 's#graphfont#simkai#' /usr/share/zabbix/include/defines.inc.php

刷新界面,字体显示正常

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值