vmware ESX5性能监控
来源:互联网 发布:nginx配置php域名访问 编辑:程序博客网 时间:2024/06/05 14:22
使用pysphere模块
利用vmware提供的web service sdk
参考:http://www.ibm.com/developerworks/cn/cloud/library/1303_jinhui_scevsphere/index.html
代码如下显示
******************************************************************************************
相应项目的详细介绍
http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.host.Summary.QuickStats.html
overallCpuUsage*xsd:int Aggregated CPU usage across all cores on the host in MHz. This is only available if the host is connected. overallMemoryUsage*xsd:int Physical memory usage on the host in MB. This is only available if the host is connected.
http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.host.CpuInfo.html
hzxsd:longCPU speed per core. This might be an averaged value if the speed is not uniform across all cores. The total CPU speed of the box is defined as hz * numCpuCores numCpuCoresxsd:short Number of physical CPU cores on the host.
http://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.wssdk.apiref.doc/vim.host.HardwareInfo.html#field_detail
memorySizexsd:longTotal amount of physical memory on the host in bytes.
还是需要进行转化
cpu利用率=(overallCpuUsage*1024*1024/hz*numCpuCores)*100
内存利用率=(overallMemoryUsage*1024*1024/memorySize)*100
至于主机内的virtual machine的性能可以参考:
http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.vm.Summary.QuickStats.html
利用vmware提供的web service sdk
参考:http://www.i
代码如下显示
from pysphere import VIServer, MORTypes, VIPropertyfrom pysphere.resources import VimService_services as VIfrom __future__ import divisionHOST="xxx.xxx.xxx.xxx"USER="root"PASSWORD="*****"s = VIServer()s.connect(HOST, USER, PASSWORD)hosts = s.get_hosts()#print hostsfor host in hosts: p = VIProperty(s, host) overallCpuUsage=p.summary.quickStats.overallCpuUsage overallMemoryUsage=p.summary.quickStats.overallMemoryUsage averagedCpuSpeedPerCore=p.hardware.cpuInfo.hz numCpuCores=p.hardware.cpuInfo.numCpuCores totalCpuSpeed=averagedCpuSpeedPerCore*numCpuCores totalMemorySize=p.hardware.memorySize try: CpuUsage=(overallCpuUsage*1024*1024/totalCpuSpeed)*100 MemoryUsage=(overallMemoryUsage*1024*1024/totalMemorySize)*100 except e: print e uptime=p.summary.quickStats.uptime #uptime unit=seconds,so need to convert to centisecond uptime=uptime*100 print "VMWARE ESXI V5 | CpuUsage=%s MemoryUsage=%s sysUpTime=%s" \ %(str(CpuUsage),str(MemoryUsage),str(uptime))s.disconnect()
******************************************************************************************
相应项目的详细介绍
http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.host.Summary.QuickStats.html
overallCpuUsage*xsd:int Aggregated CPU usage across all cores on the host in MHz. This is only available if the host is connected. overallMemoryUsage*xsd:int Physical memory usage on the host in MB. This is only available if the host is connected.
http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.host.CpuInfo.html
hzxsd:longCPU speed per core. This might be an averaged value if the speed is not uniform across all cores. The total CPU speed of the box is defined as hz * numCpuCores numCpuCoresxsd:short Number of physical CPU cores on the host.
http://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.wssdk.apiref.doc/vim.host.HardwareInfo.html#field_detail
memorySizexsd:longTotal amount of physical memory on the host in bytes.
还是需要进行转化
cpu利用率=(overallCpuUsage*1024*1024/hz*numCpuCores)*100
内存利用率=(overallMemoryUsage*1024*1024/memorySize)*100
至于主机内的virtual machine的性能可以参考:
http://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.vm.Summary.QuickStats.html
0 0
- vmware ESX5性能监控
- vmware 虚拟机导入 ESX5.5
- VMware ESX5.0上安装oracle 11g R2
- 性能监控
- 性能监控
- 性能监控
- VMWare vSphere - CPU性能分析与监控之就绪时间(ready time)分析
- VMware vSphere - 存储性能监控与分析之vscsiStats工具介绍
- ESX5上磁盘扩容
- 配置zabbix监控vmware
- [Zabbix] VMware 监控
- ESX5.1 安装Hyper v
- 使用Nagios监控VMware ESXi
- VMware Workstation性能优化
- aix性能监控
- unix性能监控
- 网站性能监控
- Apache性能监控
- cocos2d-x引入中文支持库并移植到android平台
- 电子邮件营销主题个性化优化趋势
- 实习以来完成的第一个小项目:Websphere MQ远程查看软件
- static inline内联函数
- Callback回调机制知识大全
- vmware ESX5性能监控
- Linux下高并发socket最大连接数所受的各种限制
- 无法向项目添加所有必需的程序包。无法从“C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Stack 5\Packages”安装以下程序包:
- [Office] 显示Office 2013中的Developer Tab和启用Macro
- VS 2010 使用经验
- 百度地图加入html页面(有标注,滚轮等控制事件)
- iPhone研发push功能——p12文件转pem文件
- 处理导入安卓项目Unable to resolve target 'android-i'
- 05--面向对象的三大特征