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修改为字体文件名
保存配置,刷新界面