毕业设计之zabbix集合

lnmp环境请查看https://www.cnblogs.com/betterquan/p/12285956.html

但是!!!注意php的编译:

https://www.zabbix.com/documentation/4.0/zh/manual/installation/requirements 官方文档的环境要求

 

 注意编译的时候一定要注意扩展库的启用,,有可能启动方式不一样,去php官网找与版本匹配的启动参数https://www.php.net/manual/zh/configure.about.php

环境介绍

软件

版本

nginx

https://nginx.org/download/nginx-1.16.1.tar.gz

php

https://www.php.net/distributions/php-7.3.14.tar.gz

mysql

https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.29.tar.gz

zabbix

https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.4.5/zabbix-4.4.5.tar.gz

https://www.zabbix.com/documentation/4.0/zh/manual/installation/install官方zabbix 源码安装

 具体过程关于zabbix

[[email protected] packages]useradd zabbix
[[email protected] packages]$tar -xvzf zabbix-4.4.5.tar.gz 
登陆数据库操作
mysql> create database zabbix character set=utf8;
Query OK, 1 row affected (0.00 sec)
mysql> create user 'zabbix'@'localhost' identified by 'zabbix2004';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

编译:
./configure --prefix=/usr/local/zabbix4.4.5 --enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config  --with-net-snmp --with-libcurl

编译成功后make && make install

编译可能出现的问题:

1111问题:

checking for net-snmp-config... /usr/bin/net-snmp-config
checking for main in -lnetsnmp... yes
checking for localname in struct snmp_session... yes
checking for zlib support... yes
checking for process shared libpthread support... checking for pthread.h... (cached) yes
yes
checking for libevent support... no
configure: error: Unable to use libevent (libevent check failed)

解决:

[[email protected] zabbix-4.4.5]$yum install   libevent  libevent-devel  -y

2222问题

configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config

解决

yum install -y net-snmp-devel

加入开机自启动

[[email protected] tru64]$cp /data/packages/zabbix-4.4.5/misc/init.d/tru64/zabbix_server /etc/init.d/zabbix_server
[[email protected] tru64]$chmod +x /etc/init.d/zabbix_server 
[[email protected] init.d]$vim /etc/init.d/zabbix_server 
在第二行加入:
#chkconfig: 2345 10 90 
[[email protected] init.d]$chkconfig --add zabbix_server 
[[email protected] init.d]$chkconfig zabbix_server on

zabbix4.4.5彻底汉化

如果只是简单的在管理页面进行汉化,

 在图形显示的时候会出现乱码:

 

必须通过下面方式进行修改:

zabbix4.4.5的路径和3.X的路径是不一样的了,

4.4.5的路径是在web设置目录下的assets/fonts下

在这里我是的字体存放路径是

/usr/local/nginx/html/assets/fonts

[[email protected] fonts]$cd /usr/local/nginx/html/assets/fonts
[[email protected] fonts]$ls
DejaVuSans.ttf 

默认只有这个字体,我们需要在我们的windows电脑上传字体

 

[[email protected] fonts]$ls
DejaVuSans.ttf  simhei.ttf

最好选后缀为ttf的上传,因为默认的也ttf后缀

记得修改权限:

[[email protected] html]$chown -R nginx:nginx fronts

修改环境php文件

[[email protected] include]$cd /usr/local/nginx/html/include/
[[email protected] include]$vim locales.inc.php 

修改的地方是,将下面的cs_CZ对应的display改为true
function getLocales() {
return [ 'en_GB' => ['name' => _('English (en_GB)'), 'display' => true], 'en_US' => ['name' => _('English (en_US)'), 'display' => true], 'bg_BG' => ['name' => _('Bulgarian (bg_BG)'), 'display' => false], 'ca_ES' => ['name' => _('Catalan (ca_ES)'), 'display' => false], 'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => true], 'zh_TW' => ['name' => _('Chinese (zh_TW)'), 'display' => false], 'cs_CZ' => ['name' => _('Czech (cs_CZ)'), 'display' => true],
[[email protected] include]$vim defines.inc.php 

修改的地方:
11111
define('ZBX_GRAPH_FONT_NAME',           'simhei'); // font file name

22222
define('ZBX_FONT_NAME', 'simhei');

上面simhei就是我上传的字体的不带后缀的名字,

重启生效即可

如图

猜你喜欢

转载自www.cnblogs.com/betterquan/p/12302369.html