在进行思科统一通信管理器(CUCM)相关的排错时,有时有必要抓取CUCM服务器网络接口收发的数据包。本文描述如何在CUCM服务器端进行抓包操作
CUCM 6.x/7.x/8.x
admin:utils network capture ? Syntax: utils network capture [options] options optional page,numeric,file fname,count num,size bytes,src addr,dest addr,port num,host protocol addr options are: page - pause output numeric - show hosts as dotted IP addresses file fname - output the information to a file Note: The file will be saved in platform/cli/fname.cap fname should not contain the "." character count num - a count of the number of packets to capture Note: The maximum count for the screen is 1000, for a file is 100000 size bytes - the number of bytes of the packet to capture Note: The maximum number of bytes for the screen is 128 For a file it can be any number or ALL src addr - the source address of the packet as a host name or IPV4 address dest addr - the destination address of the packet as a host name or IPV4 address port num - the port number of the packet (either src or dest) host protocol addr - the protocol should be one of the following: ip/arp/rarp/all. The host address of the packet as a host name or IPV4 address. This option will display all packets to and fro that address. Note: If "host" is provided, do not provide "src" or "dest" verbose - The verbose out put
由此可见,通过不同参数的选择,"utils network capture"命令可以抓取目标地址、源地址、端口号、指定包数量等,并将抓取到的包存为.cap文件。
一般来说,我们可以不加限制的抓取服务器网口的全部流量。命令如下:
utils network capture eth0 file packets count 100000 size all
此命令抓取全部流量,最大10000个包,并将其存为packets.cap文件
以上命令开始运行后,就可以重现需要排障的问题。问题重现的同时,CUCM将相关的流量都抓取下来,以供排错时查看。
问题重现结束后,按”ctrl+C”可以停止抓包。CUCM会将刚刚抓取到的文件存至activelog platform/cli/ 路径下。如果该路径下已经存有文件名相同的抓包文件,CUCM会自动重命名已有旧文件。
file get activelog platform/cli/packets.cap
从CUCM服务器端抓包常用于抓取以下信息: