zabbix-server5.0安装记录
作者:蓝眼泪
实验环境:centos7.9+apache+mariadb+php,win7旗舰版,vm15虚拟机
xshell7,xftp7.
具体操作过程如下
第一步,关闭防火墙和selinux
vim /etc/sysconfig/network-scripts/ifcfg-ens33
service network restart
ping www.baidu.com
iptables -F
systemctl disable firewalld
systemctl stop firewalld
systemctl status firewalld
vim /etc/selinux/config
第二步,安装zabbix-server前端和mariadb数据库
yum -y install httpd mariadb mariadb-server #安装mariadb数据库
yum install centos-release-scl
yum -y install rh-php72
yum -y install https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum install OpenIPMI OpenIPMI-libs OpenIPMI-modalias
yum install unixODBC fping -y
yum -y install rh-php72-php-mysqlnd
yum -y install rh-php72-php-bcmath rh-php72-php-fpm rh-php72-php-gd rh-php72-php-ldap rh-php72-php-mbstring
systemctl restart mariadb.service
systemctl enable mariadb.service
mysql -uroot
create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by ‘password’;
grant all privileges on zabbix.* to zabbix@localhost;
yum install zabbix-server-mysql
zcat /usr/share/doc/zabbix-server-mysql-5.0.9/create.sql.gz | mysql -u zabbix -p zabbix
vim /etc/zabbix/zabbix_server.conf
systemctl restart zabbix-server zabbix-agent httpd mariadb rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd mariadb rh-php72-php-fpm
第三步,安装zabbix-agent
rpm -ivh zabbix-agent-5.0.0-1.el7.x86_64.rpm
yum install zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
systemctl start zabbix-agent && systemctl enable zabbix-agent
netstat -lntp | grep 10050
netstat -lntp | grep 10051
zabbix_get -s 192.168.60.125 -p 10050 -k system.uname
yum install zabbix-get
zabbix_get -s 192.168.60.125 -p 10050 -k system.uname
zabbix_agentd -p | grep system.cpu.load
zabbix_get -s 192.168.60.125 -p 10050 -k system.cpu.load[all,avg1]
启动服务,包括Apache,mariadb,zabbix-server,zabbix-agent,php软件。
yum install httpd
service httpd start
systemctl restart zabbix-server zabbix-agent httpd mariadb rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd mariadb rh-php72-php-fpm
systemctl restart mariadb
systemctl enable mariadb
sudo systemctl enable zabbix-server.service
sudo systemctl start zabbix-server.service
sudo ps -ef |grep zabbix_server
yum install centos-release-scl
vim /etc/yum.repos.d/zabbix.repo
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl
vim /etc/zabbix/zabbix_server.conf
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
扫描二维码关注公众号,回复:
12653688 查看本文章

systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
修改; php_value[date.timezone] = Europe/Riga
改成 php_value[date.timezone] = Asia/shanghai
第四步,用浏览器安装zabbix-server并登录
用谷歌浏览器访问http://ip//zabbix,界面如下:
登录账号是Admn,密码是zabbix。
第五步,问题排查
1.日志查看
cat /var/log/zabbix/zabbix_agentd.log
ps -ef | grep zabbix_server
sudo netstat -anpl | grep 10051
sudo vim /etc/zabbix/zabbix_agentd.conf
uname -a (Linux查看版本当前操作系统内核信息)
cat /proc/version (Linux查看当前操作系统版本信息)
cat /proc/cpuinfo (Linux查看cpu相关信息,包括型号、主频、内核信息等)
2.字体乱码解决方案
cd /usr/share/zabbix/assets/fonts
mv graphfont.ttf graphfont.ttf.bak
rz -y
mv simsun.ttc simsun.ttf
vim /usr/share/zabbix/include/defines.inc.php
修改FONT参数为simsun ,常规宋体
systemctl restart zabbix-server.service