lizhengfa 2020-03-03
系统版本:CentOS 7
软件版本:Zabbix-4.2.1
硬件要求:无
[ ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
[ ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender
[ ~]# mysql -uroot -p'ABCabc-123' mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to identified by 'ABCabc-123'; mysql> flush privileges; mysql> quit;
[ ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p'ABCabc-123' zabbix
[ ~]# vim /etc/zabbix/zabbix_server.conf DBName=zabbix DBUser=zabbix DBPassword=ABCabc-123 DBSocket=/var/run/mysqld/mysqld.sock DBPort=3306
[ ~]# vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
[ ~]# systemctl restart zabbix-server zabbix-agent httpd [ ~]# systemctl enable zabbix-server zabbix-agent httpd [ ~]# 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 [ ~]# netstat -lnupt |grep 80 tcp6 0 0 :::80 :::* LISTEN 5034/httpd
第一次访问Zabbix我们需要配置一下Zabbix-WEB管理平台。
访问地址:http://IP/zabbix。
Zabbix初始账号密码:
Zabbix超级管理员账号:Admin
Zabbix超级管理员密码:zabbix
将电脑上的字体文件(可用黑体、楷体)上传到服务器中。
[ ~]# cd /usr/share/zabbix/fonts [ /usr/share/zabbix/fonts]# rz [ /usr/share/zabbix/fonts]# ls graphfont.ttf simkai.ttf [ /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
在浏览器直接刷新页面即可。