基于CentOS 7.x上部署Zabbix 3.4

前端之家收集整理的这篇文章主要介绍了基于CentOS 7.x上部署Zabbix 3.4前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、安装zabbix最新版epel源:

rpm-ivhhttp://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm

2、安装zabbix服务端软件包:

yuminstallzabbix-server-MysqLzabbix-web-MysqL-y

CentOS7.x上MysqL数据库叫mariadb,需要安装以下包,请大家自行yum安装:
[root@localhostconf.d]#rpm-qa|grepmaria
mariadb-5.5.52-1.el7.x86_64
mariadb-libs-5.5.52-1.el7.x86_64
mariadb-server-5.5.52-1.el7.x86_64
mariadb-test-5.5.52-1.el7.x86_64
mariadb-devel-5.5.52-1.el7.x86_64
[root@localhostconf.d]#MysqL_secure_installation#数据库初始化命令

3、安装并配置MysqL数据库

MariaDB[(none)]>createuserzabbixidentifiedby'123456';
MariaDB[(none)]>createdatabasezabbix;
MariaDB[(none)]>grantallonzabbix.*to'zabbix'@'%'identifiedby'123456';
MariaDB[(none)]>flushprivileges;

4、导入zabbix服务器数据库文件

[root@localhost~]#zcat/usr/share/doc/zabbix-server-MysqL-3.4.0/create.sql.gz|MysqL-uzabbix-p123456-Dzabbix

5、修改zabbix配置文件

[root@localhostconf.d]#more/etc/zabbix/zabbix_server.conf|grep-v"#"|grep-v"^$"
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBName=zabbix
DBUser=zabbix
DBPassword=123456#只需要设备MysqL数据库zabbix用户对应密码
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

6、修改Apache服务器下,PHP相关的配置文件

[root@localhostconf.d]#vi/etc/httpd/conf.d/zabbix.conf
PHP_valuemax_execution_time300
PHP_valuememory_limit128M
PHP_valuepost_max_size16M
PHP_valueupload_max_filesize2M
PHP_valuemax_input_time300
PHP_valuealways_populate_raw_post_data-1
PHP_valuedate.timezoneAsia/Shanghai#该项取消注释,并设置对应的时区

7、配置完成,启动zabbix管理界面完成最后的安装配置,设置zabbix-server与mariadb启动与开机启动:

[root@localhost]#systemctlstartzabbix-server
[root@localhost]#systemctlenablezabbix-server
[root@localhost]#systemctlstartmariadb
[root@localhost]#systemctlenablemariadb
[root@localhost]#systemctlstarthttpd
[root@localhost]#systemctlenablehttpd

8、Web登录http://服务器IP/zabbix,Ok搞定了!


9、Zabbix界面显示乱码问题解决

字体存放的目录:/usr/share/zabbix/fonts/

[root@localhost zabbix]# ll /usr/share/zabbix/include/defines.inc.PHP

[root@localhost zabbix]# sed -i 's/graphfont/DejaVuSans/g' ./include/defines.inc.PHP

[root@localhost zabbix]# ll fonts/

总用量 17960

-rwxrwxrwx. 1 root root 18387092 8月 24 15:48 DejaVuSans.ttf

lrwxrwxrwx. 1 root root 33 8月 24 13:55 graphfont.ttf -> /etc/alternatives/zabbix-web-font


参考文章

  1. https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages/rhel_centos

  2. https://www.zabbix.com/documentation/3.4/manual/installation/install#installing_frontend

原文链接:https://www.f2er.com/centos/376186.html

猜你在找的CentOS相关文章