Zabbix-部署+配置

Centos9——zabbixserver

rpm -Uvh https://repo.zabbix.com/zabbix/7.2/release/alma/9/noarch/zabbix-release-latest-7.2.el9.noarch.rpm
dnf clean all
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

Centos9——mysql

dnf install -y mysql-server
systemctl enable mysqld --now
systemctl status mysqld
sql语句
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'Zabbix@123';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;
sql库导入
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p Zabbix@123
# mysql -uroot -p
set global log_bin_trust_function_creators = 0;
quit;
配置zabbix_server.conf
vim /etc/zabbix/zabbix_server.conf
	DBPassword=Zabbix

Zabbix-agent

centos9

rpm -Uvh https://repo.zabbix.com/zabbix/7.2/release/centos/9/noarch/zabbix-release-latest-7.2.el9.noarch.rpm
dnf clean all
dnf install zabbix-agent

sed -i '/^Server/s#127.0.0.1#serverIP#g' /etc/zabbix/zabbix_agentd.conf 
systemctl enable zabbix-agent --now
systemctl status zabbix-agent

#####防火墙永久放行agent端口#####
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --reload

centos7

yum install pcre2 pcre2-devel -y
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/6.0/rhel/7/x86_64/zabbix-agent-6.0.7-1.el7.x86_64.rpm

sed -i '/^Server/s#127.0.0.1#serverIP#g' /etc/zabbix/zabbix_agentd.conf 
systemctl enable zabbix-agent --now
systemctl status zabbix-agent

#####防火墙永久放行agent端口#####
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --reload

SUSE

rpm --import https://repo.zabbix.com/zabbix-official-repo.key
zypper addrepo https://repo.zabbix.com/zabbix/6.4/sles/15/x86_64/ zabbix
zypper refresh
zypper install zabbix-agent -y

sed -i '/^Server/s#127.0.0.1#serverIP#g' /etc/zabbix/zabbix_agentd.conf 
systemctl enable zabbix-agent --now
systemctl status zabbix-agent

#####防火墙永久放行agent端口#####
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --reload

Windows agent见附件
##############################################################

Zabbix监控配置

1. 服务端配置

修改conf配置

#vim /etc/zabbix/zabbix_server.conf
————————————————————————————————————————————————————————————————————————————————————————————————
StartVMwareCollectors=0  #用于设置监控VMWARE Esxi主机实例时使用,若为0则不启用,若要监控ESXI主机,此值最少为1 ;视监控ESXI数量设置对应数值,一般不超过被监控VMware主机的2倍
VMwareFrequency=60       #Zabbix将连接到VMware服务以获取新数据的频率。默认是60秒
VMwarePerfFrequency=60   #Zabbix将连接到VMware服务以获取性能数据的频率。默认是60秒
VMwareCacheSize=8M       #划出多少共享内存用于存储VMWARE数据,范围是256K-2G
VMwareTimeout=10         #指定vmware收集器等待VMware服务响应的秒数。
————————————————————————————————————————————————————————————————————————————————————————————————
注:配置后的注释信息需要剔除,会影响服务启动。
#systemctl restart zabbix-server.service

2. vcenter配置

2.1 创建账号,并确保启用
在这里插入图片描述
在这里插入图片描述

2.2 全局权限分配——只读

依次选择“全局权限”→添加权限,选择用户或用户组所在的域,搜索用户组或用户名(创建用户组的,请搜索用户组,直接创建用户的可以直接搜索对应用户),角色关联内置的“只读”,前面选择为用户组的,需要勾选“传播到子对象”

在这里插入图片描述

3. ESXI设置

选择Esxi主机→点击配置→点击高级系统设置→找到“Config.HostAgent.plugins.solo.enableMob”(默认值为false修改为true)
在这里插入图片描述

4. 监控页配置

4.1 确定sdk接口打开

curl -i -k --data “” https://192.168.11.11/sdk,返回结果中有500即可。
在这里插入图片描述

4.2 创建主机,链接模板

在这里插入图片描述

4.3 添加宏

{$VMWARE.PASSWORD}			 ###来源为1.2中创建密码
{$VMWARE.URL}			 	###https://vcenterIP/sdk		
{$VMWARE.USERNAME}			 ###来源为1.2中创建用户
{$VMWARE.UUID}				###https://serverIP/mob/?moid=ServiceInstance&doPath=content.about

在这里插入图片描述

图形界面乱码问题

在这里插入图片描述

1、从Windows拷贝字体文件

控制面板——>外观和个性——>字体
在这里插入图片描述

2、上传至server服务器

/usr/share/zabbix/ui/assets/fonts

在这里插入图片描述

3. 修改配置

/usr/share/zabbix/ui/include/defines.inc.php
graphfont修改为字体文件名
在这里插入图片描述

保存配置,刷新界面
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值