vsphere zabbix_Zabbix 添加vmware esxi监控

本文介绍了如何使用Zabbix监控VMware ESXi,包括导入特定模板,安装依赖,创建只读账户,获取VMWare主机UUID信息,设置Zabbix宏以及配置外部脚本和重启Zabbix服务。
摘要由CSDN通过智能技术生成

1) Import the provided template.

- TEMPLATE.VMWARE_ESXi_6.0_CIM.xml

2) Install Dependencies:

# yum -y install sblim-wbemcli.x86_64 pywbem.noarch python2-pyvmomi.noarch python-setuptools jq python-setuptools zabbix-sender.x86_64

# pip install pysphere

# pip install  docopt

3) Create a read only account on your VMWare ESXi with enough privileges to collect the data you want to monitor.

You can create such account with the following commands:

# /usr/lib/vmware/auth/bin/adduser -s /sbin/nologin -D -H zabbix -G root

# echo "YOUR_PASSWORD" | /usr/lib/vmware/auth/bin/passwd --stdin zabbix

# vim-cmd vimsvc/auth/role_add CIM_ReadOnly Host.Cim.CimInteraction System.Anonymous

# vim-cmd vimsvc/auth/entity_permission_add vim.Folder:ha-folder-root 'zabbix' false CIM_ReadOnly true

4) VMWare Host UUID information:

You need to enable MOB VIB, because esxcli may not provide a valid UUID for this template.

To enable mob via CLI:

vim-cmd proxysvc/add_np_service "/mob" httpsWithRedirect /var/run/vmware/proxy-mob

To disable mob via CLI:

vim-cmd proxysvc/remove_service "/mob" "httpsWithRedirect"

You can also enable MOB VIB via vSphere:

1. Go to your vsphere Advanced Settings, Config, Hostagent, plugins, solo, check "Config.HostAgent.plugins.solo.enableMob"

2. Browse to https://YOUR_ESX_HOST_IP/mob/?moid=ha-host&doPath=hardware.systemInfo and copy the UUID.

3. Disable MOB vib again (uncheck Config.HostAgent.plugins.solo.enableMob)

You can also obtain the UUID information through the collected data, on "CIM Hardware" item on Zabbix dashboard after 10 minutes of collected data.

An anternate way, is to execute "esxcfg-info -u". But you may need to convert the results to lowercase.

5) Zabbix Macros:

{$USERNAME} zabbix

{$PASSWORD} YOUR_PASSWORD

{$URL} https://YOUR_ESX_HOST_IP/sdk

{$UUID} your-uuid-collected-information

6) Scripts on ExternalScrips directory.

Put the bundled scripts on your ExternalScrips directory of your Zabbix Proxy or Zabbix Server, and apply the necessary privileges:

# chmod a+x agent_vsphere_wrapper agent_vsphere

7)restart zabbix-server

systemctl restart zabbix-server

附件可以下载

https://share.zabbix.com/index.php?option=com_mtree&task=att_download&link_id=755&cf_id=39

要在Zabbix 5.0中监控VMware ESXi 6.7,你需要使用ZabbixvSphere插件。以下是具体步骤: 1. 安装vSphere插件:在Zabbix服务器上,使用以下命令安装vSphere插件: ``` yum install zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese zabbix-web-chinese zabbix-web-nginx24 ``` 2. 配置vSphere插件:在Zabbix服务器上,编辑Zabbix配置文件zabbix_server.conf,添加以下行: ``` StartVMwareCollectors=5 VMwareCacheSize=8M VMwareFrequency=60 VMwarePerfFrequency=60 VMwareTimeout=10 ``` 3. 在Zabbix Web中添加vSphere资源:在Zabbix Web中,导航到“配置”>“主机”>“创建主机”,选择“vSphere”作为主机类型,并填写以下详细信息: - 主机名:VMware ESXi服务器的IP地址或主机名 - 连接信息:vSphere管理员用户名和密码 - 监视对象:选择要监视的虚拟机和数据中心 4. 配置Zabbix代理:在VMware ESXi服务器上,配置Zabbix代理以与Zabbix服务器通信。要安装Zabbix代理,请使用以下命令: ``` yum install zabbix-agent ``` 然后编辑Zabbix代理配置文件zabbix_agentd.conf,添加以下行: ``` Server=<Zabbix服务器IP地址> ServerActive=<Zabbix服务器IP地址> ``` 重启Zabbix代理以使更改生效。 5. 测试监控:在Zabbix Web中,导航到“监控”>“最新数据”,选择VMware ESXi服务器和要监视的指标,例如CPU使用率或内存使用率。如果一切正常,你应该看到数据图表。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值