跳转到主内容

如何在ONTAP 9™2至9.9系统上捕获数据包跟踪(tcpdump)

Views:
311
Visibility:
Public
Votes:
4
Category:
ontap-9
Specialty:
nas
Last Updated:

适用场景

ONTAP 9.2至9.9

问题描述

操作步骤用于捕获ONTAP 9™2至9.9系统上的数据包跟踪(tcpdump)。

操作步骤

 

警告

  • 请始终尽可能筛选单个客户端IP上的数据包跟踪
    • 如果多个客户端受到影响、请选择1以重点进行故障排除
  • 在最小值为4096的系统上使用-buffer 标志、以确保跟踪不会筛选数据包
  • 请勿按照此操作步骤捕获 网络端口中收到的CRC错误。

 

::> network tcpdump start -node <node> -port <port/ifgrp/vlan> -address <client-ip/lif-ip/etc.> -buffer-size 2097151

注:  

  • -node-port 为 必填项
  • 此命令的节点或端口不能使用通配符
  • 如果ifgrp (例如a0a)具有VLAN (例如a0a-117)、则指定a0a 将仅捕获本机VLAN (未标记)流量
  • -address 选项 只能指定一个IP地址来筛选跟踪。
  • -protocol-port  选项允许按一个端口对跟踪进行TCP和UDP流量筛选。
  • 滚动跟踪:

::> network tcpdump start -node cl1-n1 -port e0b -file-size 512 -rolling-traces 4 -address 10.1.1.2 -protocol-port 445

注:

  • 此跟踪最多可汇总4个跟踪文件、每个跟踪文件大小为512 MB (首先删除最旧的文件)。
  • 它会跟踪选定端口、并筛选IP地址10.1.11.2.和TCP/UDP端口445。]
     
  • 要显示正在运行的数据包跟踪(network tcpdump show (pack.com) NetApp):

::> network tcpdump show

 ::> tcpdump stop -node <node> -port [*|<port>]

  • 要停止所有跟踪:

::> tcpdump stop *

::> network tcpdump trace show

注意:ONTAP将跟踪文件存储在 /mroot /etc/log/packet_traces

::> network tcpdump trace delete -node <node> -trace-file *

  • 通过Web浏览器检索数据包跟踪:
    • HTTP (s)://Slog/SPI/SPC/<CLUSTER_MGMT_IP><NODE_NAME>/etc/log/packet_tracs/

注意: 要访问SPI、需要使用集群凭据

空间注意事项

  • 如果要收集大量跟踪、请使用df -h  命令确认 节点的根卷具有足够的空间。
    • 在开始数据包跟踪之前,可用的跟踪总大小(文件大小乘以跟踪数)应超过两倍。
  • 默认情况下、跟踪文件 会添加到Snapshot副本中、因此vol0 (根卷)可能会 快速填满、从而导致中断
    • 要避免在快照中捕获跟踪文件时占用根卷空间、请执行以下操作:
      • 从要收集跟踪的节点的nobeshell禁用节点根卷上的自动Snapshot

::> run -node <node> -command "vol options vol0 nosnap on" 

::> run -node <node> -command "snap list vol0"

::> run -node <node> -command "snap delete vol0 <snap name>"

  • 完成数据包跟踪收集后、如果根卷Snapshot最初已启用、请重新启用它们
    • 从  已禁用Snapshot的节点的nochell

::> run -node <node> -command "vol options vol0 nosnap off"

 

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.