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#数据库初始化命令
MariaDB[(none)]>createuserzabbixidentifiedby'123456'; MariaDB[(none)]>createdatabasezabbix; MariaDB[(none)]>grantallonzabbix.*to'zabbix'@'%'identifiedby'123456'; MariaDB[(none)]>flushprivileges;
[root@localhost~]#zcat/usr/share/doc/zabbix-server-MysqL-3.4.0/create.sql.gz|MysqL-uzabbix-p123456-Dzabbix
[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
[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搞定了!
字体存放的目录:/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
参考文章:
原文链接:https://www.f2er.com/centos/376186.html