zabbix基础入门
zabbix 快速入门
C/S架构的服务
- 服务端:zabbix-server
- 客户端:zabbix-agent
zabbix官网:https://www.zabbix.com/
# 1.下载zabbix的yum源
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# 2.安装zabbix的服务端和客户端
[root@zabbix ~]# yum install zabbix-server-mysql zabbix-agent
# 3.下载zabbix前端web页面的yum源
yum install centos-release-scl -y
# 4.打开zabbix的yum源中的前端仓库
[root@zabbix ~]# vim /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend enabled=0 // 改为 1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
# 5.安装zabbix前端web页面
[root@zabbix ~]# yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl -y
# 6.初始化zabbix数据库
1.创建zabbix数据库
mysql> create database zabbix character set utf8 collate utf8_bin;
2.创建zabbix用户
mysql> grant all on zabbix.* to zabbix@'172.16.1.%' identified by '123';
3.将zabbix的建表语句sql文件发送到主库上
[root@zabbix ~]# scp /usr/share/doc/zabbix-server-mysql-5.0.26/create.sql.gz 172.16.1.51:/tmp/
4.主库导入sql文件
[root@db01 ~]# zcat /tmp/create.sql.gz |mysql -uzabbix -p123 -h172.16.1.51 zabbix
# 7.修改zabbix服务端配置文件
[root@zabbix ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=172.16.1.51
DBUser=zabbix
DBName=zabbix
DBPassword=123
# 8.修改zabbix的php配置文件
[root@zabbix ~]# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
[zabbix]
user = nginx
group = nginx
listen.acl_users = nginx
php_value[date.timezone] = Asia/Shanghai
# 9.1授权
[root@zabbix ~]# chown -R root.nginx /var/opt/rh/rh-php72/lib/php/session/
# 10.启动
[root@zabbix ~]# systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
# 11.查看端口
[root@zabbix ~]# netstat -lntup|grep 10050
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 19184/zabbix_agentd
tcp6 0 0 :::10050 :::* LISTEN 19184/zabbix_agentd
[root@zabbix ~]# netstat -lntup|grep 10051
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 19197/zabbix_server
tcp6 0 0 :::10051
# 12.授权
[root@zabbix ~]# chown -R nginx.nginx /etc/zabbix/web
解决汉子无法显示问题
# 在windows中找到中文字体
C:\Windows\Fonts
# 备份zabbix默认字体
[root@zabbix ~]# cd /usr/share/zabbix/assets/fonts/
[root@zabbix fonts]# mv graphfont.ttf graphfont.ttf.bak
# 上传电脑中的文件
# 改名
[root@zabbix fonts]# mv STKAITI.TTF graphfont.ttf
标签:入门,0.0,基础,nginx,zabbix,yum,mysql,root
From: https://www.cnblogs.com/ghjhkj/p/16614281.html