在本章节中,我们将在交换机上执行一个SNMP 发现 。
从Zabbix server/proxy 6.4开始,支持 SNMP OIDs 这种发现方法。
必须使用自动发现规则中的宏来创建 相关项目 类型监控项原型。
相关项目监控项从 walk[]
主监控项中获取值。因此,不需要让每个自动发现监控项单独再去轮询 SNMP 设备。
触发器和图形原型也可以通过使用自动发现规则中的宏来创建。.
Dynamic indexes (for example, interface indexes) can shift when hardware is reconfigured. To accommodate this behavior, a master SNMP walk discovery rule is created with a key such as:
After SNMP walk to JSON preprocessing, the result might resemble:
A dependent item prototype uses the {#SNMPINDEX}
macro to construct the key:
Preprocessing for this prototype includes "SNMP walk value" name with "1.3.6.1.2.1.2.2.1.10.{#SNMPINDEX}" OID in the Parameter field. Format: "Unchanged".
At runtime, actual items such as net.if.in[2]
and net.if.in[3]
are created. If a given interface index changes (for example, if the index 2
is replaced by 5
in the SNMP table), then on the next run of the discovery rule:
Trigger prototype example:
Graph prototype example includes items:
This configuration ensures reliable monitoring of tables with dynamic indexes while minimizing SNMP traffic—only a single SNMP walk per poll cycle is required, with dependent item prototypes extracting the necessary values.
当服务器运行时,它将根据 SNMP 发现规则返回的值创建真实的依赖项、触发器和图表。