This is a translation of the original English documentation page. Help us make it better.

4 SNMP OIDsの検出

概要

このセクションでは、スイッチに対してSNMP 検出を実行します。

このSNMP OID検出方法は、Zabbixサーバー/プロキシ6.4以降でサポートされています。

アイテムキー

SNMP OID フィールドに以下のアイテムキーを使用して、SNMP アイテムを作成します。

walk[1.3.6.1.2.1.2.2.1.2,1.3.6.1.2.1.2.2.1.3]

このアイテムは、パラメータで指定された OID (1.3.6.1.2.1.2.2.1.2, 1.3.6.1.2.1.2.2.1.3) に対して snmpwalk を実行し、連結された値のリストを返します。例:

.1.3.6.1.2.1.2.2.1.2.1 = STRING: "lo"
       .1.3.6.1.2.1.2.2.1.2.2 = 文字列: "ens33"
       .1.3.6.1.2.1.2.2.1.2.3 = 文字列: "ens37"
       .1.3.6.1.2.1.2.2.1.3.1 = 整数: 24
       .1.3.6.1.2.1.2.2.1.3.2 = 整数: 6
       .1.3.6.1.2.1.2.2.1.3.3 = 整数: 6

Dependent item

Go to the discovery rules of your template/host. Click on Create discovery rule in the upper right corner of the screen.

Fill in the required details in the Discovery rule tab:

  • Select Dependent item as item type
  • Select the previously created SNMP walk item as the master item
  • Fill the name and key with meaningful values

In the Preprocessing tab, select the SNMP walk to JSON preproccesing step.

In the field name specify a valid LLD macro name. Select the corresponding OID path to discover values from.

This rule will discover entities and set:

  • {#IFDESCR} macros to lo, ens33, and ens37;
  • {#IFTYPE} macros set to 24, 6, and 6.

A built-in macro {#SNMPINDEX} containing the index of the discovered OIDs is applied to discovered entities. The discovered entities are grouped by {#SNMPINDEX} macro value: 1, 2 and 3:

[
           {
               "{#SNMPINDEX}": "1",
               "{#IFDESCR}": "lo",
               "{#IFTYPE}": "24"
           },
           {
               "{#SNMPINDEX}": "2",
               "{#IFDESCR}": "ens33",
               "{#IFTYPE}": "6"
           },
           {
               "{#SNMPINDEX}": "3",
               "{#IFDESCR}": "ens37",
               "{#IFTYPE}": "6"
           }
       ]

If an entity does not have the specified OID, then the corresponding macro will be omitted for this entity.

アイテム、トリガー、グラフのプロトタイプ

アイテムのプロトタイプは、検出ルールのマクロを使用して、依存アイテムのプロトタイプとして作成する必要があります。

依存アイテムは、walk[] マスターアイテムから値を取得します。そのため、検出された各アイテムが個別にSNMPデバイスにクエリを実行する必要はありません。

トリガーとグラフのプロトタイプも、検出ルールのマクロを使用して作成できます。

検出されたエンティティ

サーバーが実行される際、SNMP検出ルールが返す値に基づいて、実際の依存アイテム、トリガー、グラフが作成されます。