安装Zabbix到CentOS(YUM)

运行环境

系统版本:CentOS 7
软件版本:Zabbix-4.2.1
硬件要求:无

安装过程

1、安装YUM-Zabbix存储库

[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm

2、安装Zabbix Server、WEB、Agent

[root@localhost ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender

3、创建初始数据库

[root@localhost ~]# mysql -uroot -p'ABCabc-123'
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'ABCabc-123';
mysql> flush privileges;
mysql> quit;

4、导入初始表结构和数据

[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p'ABCabc-123' zabbix

5、配置Zabbix Server

[root@localhost ~]# vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=ABCabc-123
DBSocket=/var/run/mysqld/mysqld.sock
DBPort=3306

6、配置Zabbix WEB

[root@localhost ~]# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai

7、启动Zabbix Server

[root@localhost ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@localhost ~]# systemctl enable zabbix-server zabbix-agent httpd
[root@localhost ~]# netstat -lnupt |grep zabbix
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      5040/zabbix_agentd  
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      5049/zabbix_server  
tcp6       0      0 :::10050                :::*                    LISTEN      5040/zabbix_agentd  
tcp6       0      0 :::10051                :::*                    LISTEN      5049/zabbix_server  
[root@localhost ~]# netstat -lnupt |grep 80
tcp6       0      0 :::80                   :::*                    LISTEN      5034/httpd  

8、初次访问

第一次访问Zabbix我们需要配置一下Zabbix-WEB管理平台。
访问地址:http://IP/zabbix。





Zabbix初始账号密码:
Zabbix超级管理员账号:Admin
Zabbix超级管理员密码:zabbix

10、设置语言为简体中文


11、解决图形中文乱码问题

将电脑上的字体文件(可用黑体、楷体)上传到服务器中。

[root@localhost ~]# cd /usr/share/zabbix/fonts
[root@localhost /usr/share/zabbix/fonts]# rz
[root@localhost /usr/share/zabbix/fonts]# ls
graphfont.ttf  simkai.ttf
[root@localhost /usr/share/zabbix/fonts]# vim /usr/share/zabbix/include/defines.inc.php
# define('ZBX_GRAPH_FONT_NAME',           'graphfont'); // font file name
define('ZBX_GRAPH_FONT_NAME',           'simkai'); // font file name

在浏览器直接刷新页面即可。

猜你喜欢

转载自www.cnblogs.com/network-ren/p/12400746.html