Zabbix 添加vmware esxi监控
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
最新文章
- 畅通工程续——E
- jquery的each()详细介绍
- logging mod
- 安装完eos出的问题
- android拍照选择图片上传服务器自定义控件
- linux设置ulimit值永久生效
- c 计算 语句 执行 时间
- AD15高版软件卡不卡,问题解决大讨论
- 泰泽新闻:英特尔三星双否认泰泽Tizen系统已死
- android studio 导入的项目有乱码-笔记2
- Sql 知识点小结
- Chris Richardson微服务翻译:构建微服务之使用API网关
- 第59章 IdentityServer交互服务 - Identity Server 4 中文文档(v1.0.0)
- 简单的自定义ViewGroup
- redis工具
- mysql5.7.18.1修改用户密码报错ERROR 1054 (42S22): Unknown column 'password' in 'field list'解决办法
- odoo 打印格式中 打印第一个数据默认
- Linux系统上查找已安装软件的路径
- Mysql Bypass小结
- LocalDateTime json格式化