MID Server の SNMP 問題をトラブルシューティングする方法(Discovery、Service Mapping、および Orchestration 向け)Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Discovery、Service Mapping、および Orchestration に影響する MID Server の SNMP 問題をトラブルシューティングします。この記事では、MID Server を経由したターゲット CI からの SNMP データ収集に関する問題を診断するためのツールおよび手法について説明します。 トラブルシューティングツール SNMP(Discovery、Orchestration、Service Mapping)を使用するアプリケーションでよく見られる問題として、SNMP データが完全には返されない、またはまったく返されないことがあります。データが返される場合は、調査対象を Script Include やビジネスルールなど、アプリケーションの別の領域に移す必要があります。まずはデータが正常に収集されているかを確認することから始めるのがよいでしょう。 SNMP クエリが目的のデータを収集できない主な理由は次の 2 つです。 無効な SNMP 認証情報SNMP クエリのタイムアウト データが返されているかを確認するために、次のツールを使用できます。 MID Server ログSNMP walk ツールWireshark 認証情報テスト SNMP 認証情報をテストするには: Discovery > Credentials に移動します。SNMP Discovery で使用される SNMP 認証情報を選択します。Test Credential リンクを選択します。Target と MID Server の値を入力します。OK を選択します。 Note: Shazzam プローブおよび SNMP 認証情報テストは OID 1.3.6.1.2.1.1.1 (sysDescr) を照会します。しかし、SNMP プローブは実際の SNMP リクエストを実行する前に、認証情報が有効かどうかを判断するため OID 1.3.6.1.2.1.1.2 (sysObjectID) を要求します。ターゲットデバイスは、正常に Discovery されるために 1.3.6.1.2.1.1.1 と 1.3.6.1.2.1.1.2 の両方へ応答する必要があります。SNMP Discovery の問題をトラブルシューティングする場合は、両方の OID をテストしてください。 MID サーバーログの確認 SNMP クエリについてより詳細な情報を MID Server ログに出力するには、パラメータ mid.log.level を debug に設定します。手順については、Add a MID Server parameter を参照してください。 デバッグログを有効化した後、問題を再現し、MID Server のログファイルを確認します。ログファイルの収集手順については、次のドキュメントを参照してください。 Monitor the MID ServerManage ECC Queue content for a MID Server 詳細な SNMP ログを有効にする MID Server 上の agent\conf フォルダーに移動します。wrapper-override ファイルを開きます。追加の Java パラメーターに次の行を追加します。 wrapper.java.additional.201=-Dsnmp4j.LogFactory=com.service_now.mid.extension.trap.Snmp4j2DiscoLogFactory MID Server を再起動します。問題を再現します。 例:成功した SNMP クエリー 次のログは、SNMP - Classify プローブのすべての OID が返された成功例を示しています。classify プローブは、デフォルトのタイムアウト 1500 ms で実行されました。ログ、OID、出力内容は原文のまま保持してください。 08/29/18 11:32:52 (911) Worker-Interactive:SNMP Worker starting: SNMP source: 08/29/18 11:32:52 (926) Worker-Interactive:SNMP DEBUG: Timeout: 1500, Retries: 2 08/29/18 11:32:53 (004) Worker-Interactive:SNMP DEBUG: Using GETBULK 08/29/18 11:32:53 (004) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.4.20.1.1, 1.3.6.1.2.1.4.20.1.2, 1.3.6.1.2.1.4.20.1.3], max rows: 10 08/29/18 11:32:53 (051) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.4.1.9.9.46.1.3.1.1.3], max rows: 10 08/29/18 11:32:53 (051) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.2.2.1.1, 1.3.6.1.2.1.2.2.1.2, 1.3.6.1.2.1.2.2.1.3, 1.3.6.1.2.1.2.2.1.6, 1.3.6.1.2.1.2.2.1.7, 1.3.6.1.2.1.2.2.1.8], max rows: 10 08/29/18 11:32:53 (114) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.47.1.1.1.1.11, 1.3.6.1.2.1.47.1.1.1.1.13, 1.3.6.1.2.1.47.1.1.1.1.2, 1.3.6.1.2.1.47.1.1.1.1.12, 1.3.6.1.2.1.47.1.1.1.1.4], max rows: 10 08/29/18 11:32:53 (161) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.4.22.1.1, 1.3.6.1.2.1.4.22.1.2, 1.3.6.1.2.1.4.22.1.3], max rows: 10 08/29/18 11:32:53 (161) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.25.3.2.1.2, 1.3.6.1.2.1.25.3.2.1.3], max rows: 10 08/29/18 11:32:53 (161) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.43.5.1.1.17], max rows: 10 08/29/18 11:32:53 (176) Worker-Interactive:SNMP DEBUG: Event: GenericScalarMetricEvent 08/29/18 11:32:53 (176) Worker-Interactive:SNMP DEBUG: Event: CheckSessionCanceledEvent, correlator: , sysID: 405c1f5cdb54a7008597d8c75e961967, canceled: false 08/29/18 11:32:53 (176) Worker-Interactive:SNMP Enqueuing: C:\ServiceNow\emprcoeljak\agent\work\monitors\ECCSender\output_0\ecc_queue.405c1f5cdb54a7008597d8c75e961967.xml 08/29/18 11:32:53 (176) Worker-Interactive:SNMP DEBUG: Event: GenericCounterMetricEvent 08/29/18 11:32:53 (192) Worker-Interactive:SNMP DEBUG: ** enqueued C:\ServiceNow\emprcoeljak\agent\work\monitors\ECCSender\output_0\ecc_queue.405c1f5cdb54a7008597d8c75e961967.xml 08/29/18 11:32:53 (192) Worker-Interactive:SNMP DEBUG: Event: MessageProcessedEvent, sysID: 405c1f5cdb54a7008597d8c75e961967 08/29/18 11:32:53 (192) Worker-Interactive:SNMP DEBUG: Event: SendMessageEvent, message: SNMP SNMP - Classify: 61 OIDs 08/29/18 11:32:53 (192) Worker-Interactive:SNMP Worker completed: SNMP source: time: 0:00:00.250 例:失敗したSNMP クエリー (タイムアウト) 次のログは一部のみ成功したクエリを示しています。OID の一部のみが返されました。タイムアウト条件をシミュレートするため、タイムアウトは 10 ms に設定されています。 08/30/18 07:29:03 (997) Worker-Interactive:SNMP DEBUG: Timeout: 10, Retries: 2 08/30/18 07:29:03 (997) Worker-Interactive:SNMP DEBUG: Snmp4jSessionFactory: connection created for key SnmpSessionPoolKey[target: &port:161&fixed_cred:&tag:] 08/30/18 07:29:04 (075) Worker-Interactive:SNMP DEBUG: Using GETBULK 08/30/18 07:29:04 (075) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.4.22.1.1, 1.3.6.1.2.1.4.22.1.2, 1.3.6.1.2.1.4.22.1.3], max rows: 10 08/30/18 07:29:04 (075) Worker-Interactive:SNMP DEBUG: First attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.4.20.1.1, 1.3.6.1.2.1.4.20.1.2, 1.3.6.1.2.1.4.20.1.3], max rows: 10 08/30/18 07:29:04 (122) Worker-Interactive:SNMP DEBUG: First attempt of getTable failed on target: /161, OIDs: [1.3.6.1.2.1.4.20.1.1, 1.3.6.1.2.1.4.20.1.2, 1.3.6.1.2.1.4.20.1.3], error: Request timed out. 08/30/18 07:29:04 (122) Worker-Interactive:SNMP DEBUG: Second attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.4.20.1.1, 1.3.6.1.2.1.4.20.1.2, 1.3.6.1.2.1.4.20.1.3], max rows: 5 08/30/18 07:29:04 (169) Worker-Interactive:SNMP DEBUG: Second attempt of getTable failed on target: /161, OIDs: [1.3.6.1.2.1.4.20.1.1, 1.3.6.1.2.1.4.20.1.2, 1.3.6.1.2.1.4.20.1.3], error: Request timed out. 08/30/18 07:29:04 (169) Worker-Interactive:SNMP DEBUG: Third attempt of getTable on target: /161, OIDs: [1.3.6.1.2.1.4.20.1.1, 1.3.6.1.2.1.4.20.1.2, 1.3.6.1.2.1.4.20.1.3], max rows: 5, forcing GETNEXT pdu type 08/30/18 07:29:04 (215) Worker-Interactive:SNMP DEBUG: Event: GenericScalarMetricEvent 08/30/18 07:29:04 (215) Worker-Interactive:SNMP DEBUG: Event: CheckSessionCanceledEvent, correlator: , sysID: 561ea3acdbdca7008597d8c75e96191a, canceled: false 08/30/18 07:29:04 (215) Worker-Interactive:SNMP Enqueuing: C:\ServiceNow\emprcoeljak\agent\work\monitors\ECCSender\output_0\ecc_queue.561ea3acdbdca7008597d8c75e96191a.xml 08/30/18 07:29:04 (215) Worker-Interactive:SNMP DEBUG: Event: GenericCounterMetricEvent 08/30/18 07:29:04 (231) Worker-Interactive:SNMP DEBUG: ** enqueued C:\ServiceNow\emprcoeljak\agent\work\monitors\ECCSender\output_0\ecc_queue.561ea3acdbdca7008597d8c75e96191a.xml 08/30/18 07:29:04 (231) Worker-Interactive:SNMP DEBUG: Event: MessageProcessedEvent, sysID: 561ea3acdbdca7008597d8c75e96191a 08/30/18 07:29:04 (231) Worker-Interactive:SNMP DEBUG: Event: SendMessageEvent, message: SNMP SNMP - Classify: 12 OIDs 08/30/18 07:29:04 (231) Worker-Interactive:SNMP Worker completed: SNMP source: time: 0:00:00.218 SNMP ウォークツール SNMP walk ツールを使用すると、期待どおりに結果が返されているかを確認できます。サードパーティ製ツールでも失敗する、または結果が一部しか返されない場合、この問題は MID Server の SNMP 実装固有のものではないことを確認できます。サードパーティ製ツールが一貫して成功する場合は、MID Server ログを確認して問題の可能性を調査してください。 次の例では、SnmpWalk.exe を使用して MID Server から OID 1.3.6.1.2.1.1.1 (sysDescr) に対してクエリを実行しています。この OID はデバイスの説明を返します。コマンドは使用する SNMP ツールによって異なる場合があります。 最初のテストでは、認証情報が "publi" に設定されています。これはこのデバイスの誤った community string です。正しい community string は "public" です。 C:\SNMPWalk>.\SnmpWalk.exe -r:10.127.212.181 -c:"publi" -os:.1.3.6.1.2.1.1 -op:.1.3.6.1.2.1.1.1.0%Failed to get value of SNMP variable. Timedout. または、OID が分かっている場合は、特定ノードの情報を取得するために snmpget を使用できます。 snmpget -v [version ] -c [scope] [IP address] [OID] snmpget -v 2c -c public 192.168.1.1 .1.3.6.1.2.1.1.1.0 認証情報エラーは返されません。その代わり、クエリはタイムアウトします。 次の例では、community string を "public" に修正しています。 C:\SNMPWalk>.\SnmpWalk.exe -r:10.127.212.181 -c:"public" -os:.1.3.6.1.2.1.1 -op:.1.3.6.1.2.1.1.1.0OID=.1.3.6.1.2.1.1.1.0, Type=OctetString, Value=Linux Linux-Tomcat 3.10.0-327.el7.x86_64 31 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 community string を修正した後は、タイムアウトする代わりに sysDescr の値が返されました。 Note: SNMP walk テストは、MID Server がインストールされているのと同じホスト上で、同じ認証情報設定を使用して実行してください。 ネットワークトラフィックモニタリングツール(Wiresharkの例) ネットワークトラフィック監視ツールを使用すると、パケットが送信されているか、応答が返されているかなど、問題が発生している箇所を特定できます。 セットアップ Wireshark ダウンロードページ から Wireshark をダウンロードしてインストールします。 Wireshark アプリケーションを開きます。トラフィックの収集に使用するインターフェイスを選択します。次の例では Ethernet が選択されています。 例:SNMP クエリートラフィックの確認 次の例では、table mgmt.mib-2.printmib.prtMarkerColorant.prtMarkerColorantTable prtMarkerColorantValue に対する SNMP クエリのトラフィックを確認します。 ecc_queue レコードには、返された内容が表示されます。 ターゲットデバイスへの SNMP トラフィックのみを表示するには、次の表示フィルタを使用します。 udp && ip.addr == <target_ip> スクリーンショットでは、パケット収集後にターゲット IP がループバック IP に置き換えられています。 次のスクリーンショットでは、OID の 1 つに対してデバイスから返されたデータが詳細に表示されています。 Note: Wireshark には capture filters と display filters の両方があります。 Capture filters(例: tcp port 80)は、生のパケットキャプチャサイズを削減し、キャプチャ開始前に設定します。Display filters(例: tcp.port == 80)は、パケットリストから特定のパケットを非表示にし、キャプチャ中に変更できます。 大規模なパケットキャプチャの場合は、キャプチャ開始前に capture filter を設定することでシステムパフォーマンスを向上させることができます。 Wireshark での SNMPv3 トラフィックの復号化 SNMPv3 トラフィックは暗号化されており、内容を確認するには復号する必要があります。以下の手順では、パケットをメモリ内でのみ復号します。 Wireshark でキャプチャしたパケットを開きます。Edit > Preferences > Protocols に移動します。プロトコル一覧から SNMP を選択します。Users Table 行で Edit を選択します。Add を選択し、次の詳細を入力します。 Engine ID : Wireshark の暗号化キャプチャから取得します。この値は暗号化されません。SNMP パケットヘッダーを開き、Engine ID 文字列を確認してください。Username : SNMPv3 ユーザー名を入力します。Authentication model : 認証モデル(MD5 または SHA1)を選択し、パスワードを入力します。Privacy protocol : プライバシープロトコル(DES、AES、AES192、AES256)を選択し、プライバシーパスワードを入力します。 パケット内容が復号されていることを確認します。 Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } サポートされているすべてのリリース Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } 証情報が正しいことを確認する 誤った認証情報は最も一般的な根本原因です。SNMP v1 および v2 は community string のみを使用するため設定が容易です。 SNMP v3 の場合は、以下の値がターゲットデバイスの設定と一致していることを確認してください。 ユーザー名認証プロトコル認証キープライバシープロトコルプライバシーキー サードパーティ製 SNMP walk ツールを使用して認証情報が正しいことを確認することもできます。 SNMP タイムアウトを増やす デバイスが設定されたタイムアウト内に応答できない場合や、ネットワークの問題によって遅延が発生する場合があります。ほとんどの場合、タイムアウトを増やすことで OID を取得できる可能性が高まります。 SNMP タイムアウトは MID Server ごと、またはプローブ上で直接設定できます。利用可能なパラメータについては次のドキュメントを参照してください。 SNMP プローブMID サーバー SNMP 設定パラメーター 範囲外の応答 一部のデバイスは start OID を設定できます。そのようなデバイスに対して walk を実行すると、start OID が返されます。この OID は要求範囲内にないため、その値は使用されません。認証情報が正しくても、結果はプローブに返されません。 これは想定された動作です。プローブはデバイスの分類および更新のために特定の値を要求しており、要求範囲外のものは無視されるためです。 デバッグログが有効な場合、MID Server には次のログ例が表示されます。 DefaultUDPTransportMapping_0.0.0.0/0 DEBUG: Response out of range. Received: iso.org.dod.internet.private.enterprises.f5.bigipTrafficMgmt.bigipSystem.sysGlobals.sysGlobalAttrs.sysGlobalAttr.sysAttrArpMaxEntries.0 (1.3.6.1.4.1.3375.2.1.1.1.1.1.0); Range is: 1.3.6.1.2.1.1.2 - 1.3.6.1.2.1.1.3. Request ID: 1853998886 この例では、1.3.6.1.2.1.1.2 - 1.3.6.1.2.1.1.3 の OID を要求していますが、デバイスは 1.3.6.1.4.1.3375.2.1.1.1.1.1.0 を返しています。 Note: この例の OID は説明のためのものです。実際の値はデバイスごとに異なります。 この問題を解決するには、デバイス設定を確認し、要求された OID を返すように設定されていることを確認してください。設定手順はベンダーおよびデバイスモデルによって異なるため、必要に応じて製造元のドキュメントを参照するか、ベンダーへお問い合わせください。 コンテキスト Cisco デバイスを Discovery する際、一部のプローブでは情報収集のために context を使用する必要があります。 たとえば、SNMP - Switch プローブによってトリガーされるプローブは、各 VLAN の情報を収集するために context 情報を渡す必要があります。context がない場合、デフォルト VLAN の情報のみが返されます。 詳細については、次の記事を参照してください。 SNMP:スイッチプローブ認証エラーとレイヤー 2 データが収集されないSNMPv3 がデフォルト以外の VLAN のレイヤ 2 テーブルに関する情報の収集に失敗する(Cisco スイッチのみ) Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } ディスカバリー:詳細 - SNMP 分類の機能とプロパティディスカバリーが SNMP デバイスのシリアル番号を返さない理由SNMP プローブ