centos7安裝zabbix4.2


附zabbixdocker鏡像地址

https://hub.docker.com/u/zabbix/

zabbix官方文檔

https://www.zabbix.com/cn/download

1、關閉防火牆和selinux

# systemctl stop firewalld

# vi /etc/selinux/config

SELINUX=permissive

# setenforce 0

[root@localhost ~]# systemctl is-active firewalld
active
[root@localhost ~]# 
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# 
[root@localhost ~]# getenforce 
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# 
[root@localhost ~]# vi /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

2、添加zabbix存儲庫

# rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm

[root@localhost ~]# rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.fHl7KV: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:zabbix-release-4.2-1.el7         ################################# [100%]
[root@localhost ~]# ls /etc/yum.repos.d/
mylocal.repo  zabbix.repo

 

3、安裝zabbix-server-mysql和zabbix-web-mysql

# yum install -y zabbix-server-mysql zabbix-web-mysql

要在 MySQL支持下安裝Zabbix服務器

要在 MySQL支持下安裝Zabbix前端

Installed:
  zabbix-server-mysql.x86_64 0:3.0.26-1.el7                                      zabbix-web-mysql.noarch 0:3.0.26-1.el7                                     

Dependency Installed:
  OpenIPMI-libs.x86_64 0:2.0.23-2.el7              OpenIPMI-modalias.x86_64 0:2.0.23-2.el7                dejavu-fonts-common.noarch 0:2.33-6.el7           
  dejavu-sans-fonts.noarch 0:2.33-6.el7            fontpackages-filesystem.noarch 0:1.44-8.el7            fping.x86_64 0:3.10-4.el7                         
  httpd.x86_64 0:2.4.6-88.el7.centos               httpd-tools.x86_64 0:2.4.6-88.el7.centos               iksemel.x86_64 0:1.4-2.el7.centos                 
  libX11.x86_64 0:1.6.5-2.el7                      libX11-common.noarch 0:1.6.5-2.el7                     libXau.x86_64 0:1.0.8-2.1.el7                     
  libXpm.x86_64 0:3.5.12-1.el7                     libjpeg-turbo.x86_64 0:1.2.90-6.el7                    libtool-ltdl.x86_64 0:2.4.2-22.el7_3              
  libxcb.x86_64 0:1.13-1.el7                       libxslt.x86_64 0:1.1.28-5.el7                          libzip.x86_64 0:0.10.1-8.el7                      
  mailcap.noarch 0:2.1.41-2.el7                    net-snmp-libs.x86_64 1:5.7.2-37.el7                    php.x86_64 0:5.4.16-46.el7                        
  php-bcmath.x86_64 0:5.4.16-46.el7                php-cli.x86_64 0:5.4.16-46.el7                         php-common.x86_64 0:5.4.16-46.el7                 
  php-gd.x86_64 0:5.4.16-46.el7                    php-ldap.x86_64 0:5.4.16-46.el7                        php-mbstring.x86_64 0:5.4.16-46.el7               
  php-mysql.x86_64 0:5.4.16-46.el7                 php-pdo.x86_64 0:5.4.16-46.el7                         php-xml.x86_64 0:5.4.16-46.el7                    
  t1lib.x86_64 0:5.1.2-14.el7                      unixODBC.x86_64 0:2.3.1-11.el7                         zabbix-web.noarch 0:3.0.26-1.el7                  

Complete!

 要使用MySQL支持安裝Zabbix代理

# yum install zabbix-proxy-mysql -y

[root@localhost ~]# yum install zabbix-proxy-mysql -y
Installed:
  zabbix-proxy-mysql.x86_64 0:4.2.0-1.el7

Complete!

 對服務器進行自身監控

 安裝zabbix-agent客戶端

# yum install zabbix-agent -y

設置開機自啟動

# systemctl start zabbix-agent

# chkconfig zabbix-agent on

Installed:
  zabbix-agent.x86_64 0:4.2.0-1.el7

Complete!
[root@localhost ~]#
[root@localhost ~]# chkconfig zabbix-agent on
Note: Forwarding request to 'systemctl enable zabbix-agent.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
[root@localhost ~]#

 

4、安裝並且啟動mysql5.6及初始化數據庫信息

# rpm -ivh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm

[root@localhost ~]# rpm -ivh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
Retrieving http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-release-el6-5    ################################# [100%]
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# ls
mylocal.repo  mysql-community.repo  mysql-community-source.repo  zabbix.repo
[root@localhost yum.repos.d]#

 

# yum install -y mysql-community-server

Installed:
  mysql-community-libs.x86_64 0:5.6.43-2.el6                                   mysql-community-server.x86_64 0:5.6.43-2.el6                                  

Dependency Installed:
  mysql-community-client.x86_64 0:5.6.43-2.el6        mysql-community-common.x86_64 0:5.6.43-2.el6        perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7       
  perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7         perl-DBI.x86_64 0:1.627-4.el7                       perl-IO-Compress.noarch 0:2.061-2.el7              
  perl-Net-Daemon.noarch 0:0.48-5.el7                 perl-PlRPC.noarch 0:0.2020-14.el7                  

Replaced:
  mariadb-libs.x86_64 1:5.5.60-1.el7_5                                                                                                                       

Complete!

啟動mysqld服務

# systemctl start mysqld

設置開機自啟動

# chkconfig mysqld on

[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# 
[root@localhost ~]# systemctl status mysqld
● mysqld.service - SYSV: MySQL database server.
   Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
   Active: active (running) since Wed 2019-04-03 01:21:03 CST; 12s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 68300 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=0/SUCCESS)
 Main PID: 68584 (mysqld)
   CGroup: /system.slice/mysqld.service
           ├─68380 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedi...
           └─68584 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld....

Apr 03 01:21:02 localhost.localdomain mysqld[68300]: Note: new default config file not created.
Apr 03 01:21:02 localhost.localdomain mysqld[68300]: Please make sure your config file is current
Apr 03 01:21:02 localhost.localdomain mysqld[68300]: WARNING: Default config file /etc/my.cnf exists on the system
Apr 03 01:21:02 localhost.localdomain mysqld[68300]: This file will be read by default by the MySQL server
Apr 03 01:21:02 localhost.localdomain mysqld[68300]: If you do not want to use this, either remove it, or use the
Apr 03 01:21:02 localhost.localdomain mysqld[68300]: --defaults-file argument to mysqld_safe when starting the server
Apr 03 01:21:02 localhost.localdomain mysqld[68300]: [  OK  ]
Apr 03 01:21:03 localhost.localdomain mysqld[68300]: Starting mysqld:  [  OK  ]
Apr 03 01:21:03 localhost.localdomain systemd[1]: mysqld.service: Supervising process 68584 which is not our child. We'll most likely not notice w...t exits.
Apr 03 01:21:03 localhost.localdomain systemd[1]: Started SYSV: MySQL database server..
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# 
[root@localhost ~]# chkconfig mysqld on
[root@localhost ~]# 

 

初始化數據庫信息

# mysql_secure_installation

[root@localhost ~]# mysql_secure_installation



NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):    //回車
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y - Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!




All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


Cleaning up...

 

5、創建zabbix數據庫,創建zabbix賬號

# mysql -uroot -p

創建一個zabbix庫並設置為utf8的字符編碼格式

mysql> create database zabbix character set utf8 collate utf8_bin;

創建賬戶並且授權設置密碼

給來自loclhost的用戶zabbxi分配可對數據庫zabbix所有表進行所有操作的權限,並且設定密碼為zabbix

mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';

刷新

mysql> flush privileges;

[root@localhost ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.6.43 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

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 utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

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

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

 

6、導入默認的zabbix數據庫信息

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

 

[root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-4.2.0/
[root@localhost zabbix-server-mysql-4.2.0]#
[root@localhost zabbix-server-mysql-4.2.0]# ls
AUTHORS  ChangeLog  COPYING  create.sql.gz  NEWS  README
[root@localhost zabbix-server-mysql-4.2.0]#
[root@localhost zabbix-server-mysql-4.2.0]# zcat /usr/share/doc/zabbix-server-mysql-4.2.0/create.sql.gz | mysql zabbix -uzabbix -pzabbix
Warning: Using a password on the command line interface can be insecure.
[root@localhost zabbix-server-mysql-4.2.0]#

 

7、修改zabbix_server.conf的配置文件

# grep ^DB /etc/zabbix/zabbix_server.conf

[root@localhost ~]# grep ^DB /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

# vi /etc/php.ini

在最后一行添加一下內容

php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300

8、修改系統時間

安裝ntp服務

# yum install ntpdate -y

調整為亞洲上海時區

# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 

同步時間服務器

# ntpdate us.pool.ntp.org

 

[root@localhost ~]# yum install ntpdate -y
……………………
……………………
Installed:
  ntpdate.x86_64 0:4.2.6p5-28.el7.centos                                        

Complete!
[root@localhost ~]# ntpdate us.pool.ntp.org
 4 Apr 10:00:11 ntpdate[11904]: step time server 4.53.160.75 offset -32351.195618 sec
[root@localhost ~]# date 
Thu Apr  4 10:00:26 CST 2019
[root@localhost ~]# 
[root@localhost ~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@localhost ~]#
[root@localhost ~]# ntpdate us.pool.ntp.org
 4 Apr 14:40:12 ntpdate[2807]: step time server 72.30.35.89 offset -32392.501158 sec
[root@localhost ~]#
[root@localhost ~]# date
Thu Apr  4 14:40:32 CST 2019
[root@localhost ~]#

 

9、修改配置文件/etc/httpd/conf.d/zabbix.conf,時區改成 Asia/Shanghai

# vi /etc/httpd/conf.d/zabbix.conf

[root@localhost ~]# vi /etc/httpd/conf.d/zabbix.conf
#
# Zabbix monitoring system php web frontend
#

Alias /zabbix /usr/share/zabbix

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Require all granted

    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        php_value date.timezone Asia/Shanghai
    </IfModule>
</Directory>

<Directory "/usr/share/zabbix/conf">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/app">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/include">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/local">
    Require all denied
</Directory>

10、啟動apache/zabbix-server服務並設置為開機啟動

啟動apache

# systemctl start httpd

# systemctl enable httpd

[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-04-03 01:41:59 CST; 19s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 68678 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─68678 /usr/sbin/httpd -DFOREGROUND
           ├─68679 /usr/sbin/httpd -DFOREGROUND
           ├─68680 /usr/sbin/httpd -DFOREGROUND
           ├─68681 /usr/sbin/httpd -DFOREGROUND
           ├─68682 /usr/sbin/httpd -DFOREGROUND
           └─68683 /usr/sbin/httpd -DFOREGROUND

Apr 03 01:41:59 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Apr 03 01:41:59 localhost.localdomain httpd[68678]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using l... message
Apr 03 01:41:59 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# 

 

啟動zabbix-server服務並設置為開機啟動

# systemctl start zabbix-server

# systemctl enable zabbix-server

[root@localhost ~]# systemctl start zabbix-server
[root@localhost ~]# 
[root@localhost ~]# systemctl enable zabbix-server
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
[root@localhost ~]# 

  查看zabbix-server日志

# tailf  /var/log/zabbix/zabbix_server.log

[root@localhost ~]# tailf  /var/log/zabbix/zabbix_server.log
  4618:20190404:164956.559 server #28 started [icmp pinger #1]
  4620:20190404:164956.560 server #30 started [preprocessing manager #1]
  4622:20190404:164956.560 server #32 started [preprocessing worker #2]
  4625:20190404:164956.561 server #35 started [lld worker #1]
  4624:20190404:164956.561 server #34 started [lld manager #1]
  4626:20190404:164956.561 server #36 started [lld worker #2]
  4623:20190404:164956.562 server #33 started [preprocessing worker #3]
  4619:20190404:164956.562 server #29 started [alert manager #1]
  4621:20190404:164956.562 server #31 started [preprocessing worker #1]
  4610:20190404:164958.602 enabling Zabbix agent checks on host "Zabbix server": host became available

 

zabbix-server的web目錄

# ls /usr/share/zabbix

[root@localhost ~]# ls /usr/share/zabbix
actionconf.php                 audio               discoveryconf.php            image.php        map.import.php     slides.php
adm.gui.php                    auditacts.php       disc_prototypes.php          images           map.php            srv_status.php
adm.housekeeper.php            auditlogs.php       favicon.ico                  img              overview.php       styles
adm.iconmapping.php            browserwarning.php  fonts                        imgstore.php     profile.php        sysmap.php
adm.images.php                 chart2.php          graphs.php                   include          queue.php          sysmaps.php
adm.macros.php                 chart3.php          history.php                  index_http.php   report2.php        templates.php
adm.other.php                  chart4.php          host_discovery.php           index.php        report4.php        toptriggers.php
adm.regexps.php                chart5.php          hostgroups.php               items.php        robots.txt         tr_events.php
adm.triggerdisplayoptions.php  chart6.php          hostinventoriesoverview.php  js               screenconf.php     trigger_prototypes.php
adm.triggerseverities.php      chart7.php          hostinventories.php          jsLoader.php     screenedit.php     triggers.php
adm.valuemapping.php           chart.php           host_prototypes.php          jsrpc.php        screen.import.php  usergrps.php
adm.workingtime.php            charts.php          host_screen.php              latest.php       screens.php        users.php
api_jsonrpc.php                conf                hosts.php                    local            services.php       zabbix.php
app                            conf.import.php     httpconf.php                 locale           setup.php
applications.php               correlation.php     httpdetails.php              maintenance.php  slideconf.php

 

10、訪問網站,例如:http://本機IP/zabbix,如下圖所示:

PHP版本

password是我們設置的數據庫密碼zabbix

輸入名字

 查看zabbix基礎信息

finish

Zabbix·server的默認賬號Admin 密碼zabbix,如圖所示:

基礎界面如下

根據提示可以看到上面圖形界面的操作都寫到一個配置文件中

# more /etc/zabbix/web/zabbix.conf.php

[root@localhost ~]# more /etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB;

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = 'localhost';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'zabbix';

// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'zabbix4.2';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
[root@localhost ~]#

 

移除或改名web目錄下面的setup.php文件

# mv setup.php setup.php.bak

[root@localhost ~]# cd /usr/share/zabbix
[root@localhost zabbix]#
[root@localhost zabbix]# ls
actionconf.php                 audio               discoveryconf.php            image.php        map.import.php     slides.php
adm.gui.php                    auditacts.php       disc_prototypes.php          images           map.php            srv_status.php
adm.housekeeper.php            auditlogs.php       favicon.ico                  img              overview.php       styles
adm.iconmapping.php            browserwarning.php  fonts                        imgstore.php     profile.php        sysmap.php
adm.images.php                 chart2.php          graphs.php                   include          queue.php          sysmaps.php
adm.macros.php                 chart3.php          history.php                  index_http.php   report2.php        templates.php
adm.other.php                  chart4.php          host_discovery.php           index.php        report4.php        toptriggers.php
adm.regexps.php                chart5.php          hostgroups.php               items.php        robots.txt         tr_events.php
adm.triggerdisplayoptions.php  chart6.php          hostinventoriesoverview.php  js               screenconf.php     trigger_prototypes.php
adm.triggerseverities.php      chart7.php          hostinventories.php          jsLoader.php     screenedit.php     triggers.php
adm.valuemapping.php           chart.php           host_prototypes.php          jsrpc.php        screen.import.php  usergrps.php
adm.workingtime.php            charts.php          host_screen.php              latest.php       screens.php        users.php
api_jsonrpc.php                conf                hosts.php                    local            services.php       zabbix.php
app                            conf.import.php     httpconf.php                 locale           setup.php
applications.php               correlation.php     httpdetails.php              maintenance.php  slideconf.php
[root@localhost zabbix]#
[root@localhost zabbix]# mv setup.php setup.php.bak
[root@localhost zabbix]#

 

 設置新的密碼,界面的主題、語言和登陸后顯示的默認界面等

解決中文亂碼無法顯示的問題

Windows字體目錄地址

C:\Windows\Fonts

復制到zabbix服務器中

查找Zabbix所使用的語言包

# find / -name *font* -print | grep zabbix

# ll `find / -name *font* -print | grep zabbix`

[root@localhost ~]# find / -name *font* -print | grep zabbix
/etc/alternatives/zabbix-web-font
/var/lib/alternatives/zabbix-web-font
/usr/share/zabbix/fonts
/usr/share/zabbix/fonts/graphfont.ttf
[root@localhost ~]#
[root@localhost ~]# ll `find / -name *font* -print | grep zabbix`
lrwxrwxrwx. 1 root root 38 Apr  4 14:43 /etc/alternatives/zabbix-web-font -> /usr/share/fonts/dejavu/DejaVuSans.ttf
lrwxrwxrwx. 1 root root 33 Apr  4 14:43 /usr/share/zabbix/fonts/graphfont.ttf -> /etc/alternatives/zabbix-web-font
-rw-r--r--. 1 root root 86 Apr  4 14:43 /var/lib/alternatives/zabbix-web-font

/usr/share/zabbix/fonts:
total 0
lrwxrwxrwx. 1 root root 33 Apr  4 14:43 graphfont.ttf -> /etc/alternatives/zabbix-web-font
[root@localhost ~]#

 

備份本身語言包

# mv /usr/share/fonts/dejavu/DejaVuSans.ttf /usr/share/fonts/dejavu/DejaVuSans.ttf.bak

替換成Windows的語言包

# mv simkai.ttf /usr/share/fonts/dejavu/DejaVuSans.ttf

[root@localhost ~]# mv /usr/share/fonts/dejavu/DejaVuSans.ttf /usr/share/fonts/dejavu/DejaVuSans.ttf.bak
[root@localhost ~]#
[root@localhost ~]# ls
anaconda-ks.cfg  simkai.ttf
[root@localhost ~]#
[root@localhost ~]# mv simkai.ttf /usr/share/fonts/dejavu/DejaVuSans.ttf
[root@localhost ~]#

刷新頁面已經恢復

參考博客:

https://www.cnblogs.com/Sungeek/p/9069999.html

http://www.cnblogs.com/xiewenming/p/7732144.html

 

 

zabbix4.2學習請參考這位博主
https://www.cnblogs.com/AutoSmart/p/10505090.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM