PCAP SNMP パーサーの使用

この章は、次の項で構成されています。

PCAP SNMP パーサーの使用

PCAP SNMP パーサーは、.pcap 形式でキャプチャされた SNMP パケットを分析するツールです。スイッチ上で動作し、スイッチに送信されるすべての SNMP get、getnext、getbulk、set、trap、および response 要求の統計情報レポートを生成します。

PCAP SNMP パーサーを使用するには、次のいずれかのコマンドを使用します。

  • debug packet-analysis snmp [mgmt0 | inband] duration seconds [output-file] [keep-pcap] :Tshark を使用して指定の秒数間のパケットをキャプチャし、一時 .pcap ファイルに保存します。次に、その .pcap ファイルに基づいてパケットを分析します。

    結果は出力ファイルに保存されます。出力ファイルが指定されていない場合は、コンソールに出力されます。keep-pcap オプションを使用する場合を除き、一時 .pcap ファイルはデフォルトで削除されます。パケット キャプチャは、デフォルトの管理インターフェイス(mgmt0)、または帯域内インターフェイスで実行できます。

    例:

    switch# debug packet-analysis snmp duration 100
    
    switch# debug packet-analysis snmp duration 100 bootflash:snmp_stats.log
    
    switch# debug packet-analysis snmp duration 100 bootflash:snmp_stats.log keep-pcap
    
    switch# debug packet-analysis snmp inband duration 100
    
    switch# debug packet-analysis snmp inband duration 100 bootflash:snmp_stats.log
    
    switch# debug packet-analysis snmp inband duration 100 bootflash:snmp_stats.log keep-pcap
    
    
  • debug packet-analysis snmp input-pcap-file [output-file]:既存の .pcap ファイルにあるキャプチャしたパケットを分析します。

    例:

    switch# debug packet-analysis snmp bootflash:snmp.pcap
    
    switch# debug packet-analysis snmp bootflash:snmp.pcap bootflash:snmp_stats.log
    
    

次に、debug packet-analysis snmp [mgmt0 | inband] duration コマンド の統計情報レポートの例を示します。

switch# debug packet-analysis snmp duration 10
Capturing on eth0
36
wireshark-cisco-mtc-dissector: ethertype=0xde09, devicetype=0x0
wireshark-broadcom-rcpu-dissector: ethertype=0xde08, devicetype=0x0

Started analyzing. It may take several minutes, please wait!

Statistics Report
-----------------------------------------
SNMP Packet Capture Duration: 0 seconds
Total Hosts: 1
Total Requests: 18
Total Responses: 18
Total GET: 0
Total GETNEXT: 0
Total WALK: 1 (NEXT: 18)
Total GETBULK: 0
Total BULKWALK: 0 (BULK: 0)
Total SET: 0
Total TRAP: 0
Total INFORM: 0

Hosts         GET  GETNEXT  WALK(NEXT) GETBULK  BULKWALK(BULK) SET  TRAP  INFORM  RESPONSE
------------------------------------------------------------------------------------------
10.22.27.244   0     0        1(18)      0         0(0)         0    0      0       18

Sessions
--------
1

MIB Objects GET  GETNEXT  WALK(NEXT) GETBULK(Non_rep/Max_rep) BULKWALK(BULK, Non_rep/Max_rep)
---------------------------------------------------------------------------------------------
ifName      0       0        1(18)      0                        0                             

SET     Hosts
--------------------
0       10.22.27.244