cheng029 发表于 2012-7-11 19:31:42

如何在ESX下抓取数据包

使用root账户登陆该虚拟机所在ESX Server的命令行终端,执行以下指令:
vm-support -s -i 10 -d 600

vm-support是一个用于搜集ESX信息的工具,同时还可以用来保存ESX的配置信息,最简单的用法是不带任何选项。
建议在/tmp下运行此脚本,生成的文件格式为esx-{date}.{PID}.tgz。
一个典型的vm-support运行过程为:
# time vm-support

VMware ESX Server Support Script 1.27

Preparing files: -

Error running /usr/sbin/esxcfg-info -a or writing to /tmp/esxcfg-info.27960.txt
(err 1).
Do you have a full disk?
Continuing...

Preparing files: -
Waiting up to 300 seconds for background commands to complete:

Waiting for background commands: |
Creating tar archive ...


File: /tmp/xiaoyu/esx-2006-10-24--14.47.27960.tgz
NOTE: esx-2006-10-24--14.47.27960.tgz is greater than 10 MB.
Please do not attach this file when submitting an incident report.
Please contact VMware support for an ftp site.
To file a support incident, go to http://www.vmware.com/support/sr/sr_login.jsp


To see the files collected, run: tar -tzf /tmp/xiaoyu/esx-2006-10-24--14.47.27960.tgz

Done

real    9m27.147s
user    0m56.290s
sys   1m3.770s

然后你可以用tar -tzvf esx-2006-10-24--14.47.27960.tgz显示搜集了那些文件
搜集的主要信息为:
/tmp/aamSupport.PID HA的信息(VMware的HA使用的是Legato AAM的模块)
/proc/vmware 统计信息
/proc/vmware/config 配置信息
/etc
/etc/sysconfig 系统配置信息
/vmfs/volumes VMFS信息
/var/log 日志信息
另外的一些命令的输出全部都在解压目录下的tmp目录中,如 fdisk, uptime, ifconfig,chkconfig以及一些esxcfg命令。
常用的几种方式还包括:
-x: 列出正在运行的VM, 实际上是通过ls /proc/vmware/vm/*/names命令得到信息
# vm-support -x

VMware ESX Server Support Script 1.27
Available worlds to debug:

vmid=1062   Prod-LotteryWeb
vmid=1063   Prod-DWIQ
vmid=1081   Prod-AppServer
vmid=1086   Prod-P2VHelper-CN
-X world ID: 搜集某一VM的信息(world id 可以有-x得到)


由于ESX主机上FTP功能,你可以通过SCP把数据拷贝到别的服务器在去读取。scp是有Security的文件copy,基于ssh登录。操作起来比较方便,比如要把当前一个文件copy到远程另外一台主机上,可以如下命令。
scp /home/daisy/full.tar.gz root@172.19.2.75:/home/root

llcong 发表于 2013-3-13 17:40:33

路过,学习下

314598340 发表于 2013-5-16 02:47:23

这是什么东东啊

阿斯顿阿斯顿 发表于 2013-5-18 20:15:16

人生重要的不是所站的位置,而是所朝的方向!

352262 发表于 2013-5-21 11:07:54

小手一抖,钱钱到手!

liuming794 发表于 2013-5-24 11:27:01

学习了,不错,讲的太有道理了

robin 发表于 2013-5-29 10:56:41

精典之极就是精斑!!!
页: [1]
查看完整版本: 如何在ESX下抓取数据包