1、安装zabbix最新版epel源:
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
2、安装zabbix服务端软件包:
yum install zabbix-server-mysql zabbix-web-mysql -y CentOS 7.x上MySQL数据库叫mariadb,需要安装以下包,请大家自行yum安装: [root@localhost conf.d]# rpm -qa | grep maria 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@localhost conf.d]# mysql_secure_installation #数据库初始化命令
3、安装并配置MySQL数据库:
MariaDB [(none)]> create user zabbix identified by ‘123456‘; MariaDB [(none)]> create database zabbix; MariaDB [(none)]> grant all on zabbix.* to ‘zabbix‘@‘%‘ identified by ‘123456‘; MariaDB [(none)]> flush privileges;
4、导入zabbix服务器数据库文件:
[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -u zabbix -p123456 -D zabbix
5、修改zabbix配置文件:
[root@localhost conf.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@localhost conf.d]# vi /etc/httpd/conf.d/zabbix.conf 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 always_populate_raw_post_data -1 php_value date.timezone Asia/Shanghai #该项取消注释,并设置对应的时区
7、配置完成,启动zabbix管理界面完成最后的安装配置,设置zabbix-server与mariadb启动与开机启动:
[root@localhost]# systemctl start zabbix-server [root@localhost]# systemctl enable zabbix-server [root@localhost]# systemctl start mariadb [root@localhost]# systemctl enable mariadb [root@localhost]# systemctl start httpd [root@localhost]# systemctl enable httpd
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
参考文章:
https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages/rhel_centos
https://www.zabbix.com/documentation/3.4/manual/installation/install#installing_frontend
本文出自 “MessageTech” 博客,请务必保留此出处http://msgll.blog.51cto.com/6990666/1959016
原文地址:http://msgll.blog.51cto.com/6990666/1959016