服务器:192.168.*.180
环境:yum源更新、LAMP搭建
[root@localhost ~]# yum install epel-release -y
[root@localhost ~]# yum –y install https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
[root@localhost ~]# yum –y install php-bcmath php-mbstring
[root@localhost ~]# yum -y install https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
[root@localhost ~]#yum –y install zabbix-agent zabbix-web zabbix-web-mysql zabbix-server-mysql zabbix-sender
安装完成后的zabbix_server 服务应该具备以下几个组件
[root@localhost /]# rpm -qa | grep zabbix
zabbix-agent-4.4.10-1.el7.x86_64
zabbix-release-4.4-1.el7.noarch
zabbix-web-4.4.10-1.el7.noarch
zabbix-sender-4.4.10-1.el7.x86_64
zabbix-web-mysql-4.4.10-1.el7.noarch
zabbix-server-mysql-4.4.10-1.el7.x86_64
[root@localhost /]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u zabbix –p –h 192.168.*.180 zabbix
完整的导入命令(加被导入的数据库加导入的服务器地址
grep -n ‘^’[a-Z] /etc/zabbix/zabbix_server.conf
38:LogFile=/var/log/zabbix/zabbix_server.log
49:LogFileSize=0
72:PidFile=/var/run/zabbix/zabbix_server.pid
82:SocketDir=/var/run/zabbix
101:DBName=zabbix //访问数据库名称
117:DBUser=zabbix //zabbix访问数据库用户
125:DBPassword=admin123 //配置文件中只需修改本行,zabbix访问数据库密码
347:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
465:Timeout=4
507:AlertScriptsPath=/usr/lib/zabbix/alertscripts
517:ExternalScripts=/usr/lib/zabbix/externalscripts
553:LogSlowQueries=3000
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
[root@localhost /]# sed -i ‘/# php_value date.timezone/a\ php_value date.timezone Asia/Shanghai’ /etc/httpd/conf.d/zabbix.conf
zabbix基本配置完成,启动服务,实现web界面安装
[root@localhost /]# systemctl enable zabbix-server
[root@localhost /]# systemctl start zabbix-server
[root@localhost /]# systemctl restart httpd.service
将win里面的字体上传到linux主机中。并将文件转移到/usr/share/zabbix/assets/fonts
[root@localhost /]#mv simhei.ttf /usr/share/zabbix/assets/fonts
[root@localhost /]# ll /usr/share/zabbix/assets/fonts
vi 编辑defines.inc.php
[root@localhost /]#vim /usr/share/zabbix/include/defines.inc.php
#搜索font,把所有的graphfont改为msyh
(:%s/simsun/graphfont g )
查看端口运行状态
[root@localhost ~]# ps -ef | grep zabbix-agent
进入初始界面,http://管理地址/zabbix
初始登录信息 user Admin pwd zabbix