ubuntu安装zabbix并配置中文环境
zabbix安装
关闭SELinux
vi /etc/selinux/config
SELINUX=disabled
关闭防火墙
systemctl stop firewalld.service
关闭防火墙开机启动
systemctl disable firewalld.service
安装zabbix repository
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安装zabbix server,Web前端,agent
apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent创建初始数据库
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;导入初始架构和数据,系统将提示您输入新创建的密码。
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix导入数据库架构后禁用log_bin_trust_function_creators选项
mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;为Zabbix server配置数据库
编辑配置文件 vim /etc/zabbix/zabbix_server.conf
DBPassword=password为Zabbix前端配置PHP
编辑配置文件 vim /etc/nginx/conf.d/zabbix.conf
listen 8080;
server_name example.com;启动Zabbix server和agent进程
启动Zabbix server和agent进程,并为它们设置开机自启:
systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm
systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm





配置中文
安装中文字体
#安装中文字体,
apt-get install language-pack-zh-hant language-pack-zh-hans
在windows10控制面板下载字体,将字体上传到服务器/usr/share/zabbix/assets/fonts/目录下

#上传至/usr/share/zabbix/assets/fonts/目录下,并授权。
mv /usr/share/zabbix/assets/fonts/[文件名].ttf /usr/share/zabbix/assets/fonts/graphfont.ttf
chmod 777 graphfont.ttf #修改defines.inc.php配置,修改如下,查找、ZBX_GRAPH_FONT_NAME
vim /usr/share/zabbix/include/defines.inc.php #重启服务
#重启系统
reboot登录zabbix 修改界面语言。

或者直接修改本地语言包
#或者直接更新语言包
dpkg-reconfigure locales
修改默认语言为中文
vim /etc/default/locale
把原来的en_US.UTF-8注释, 更改为zh_CN.UTF-8
#LANG="en_US.UTF-8"
LANG="zh_CN.UTF-8"
保存退出
版权声明:
本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自
锦轩个人小站!
喜欢就支持一下吧
打赏
微信
支付宝
微信
支付宝