本人的工作环境中已经有一套Zabbix平台用于监控1000台数量以上的交换机,该运维平台主要有如下作用:
查找某个区域的某台设备IP地址以方便管理员远程登录、查看/修改设备配置;
通过SNMP检测设备的在线情况;
在每天的固定时间记录当前设备在线情况,并将不在线的设备信息、地址以邮件形式发送给运维人员,以便于运维人员进行分析及巡检。
登录Zabbix Web并查看一台汇聚设备的应用集界面,如图:
共59个应用集,529个监控项,243个触发器,56个图形与2个自动发现规则。
关于59个应用集:
该设备为Huawei S6720-54C-EI-48S-AC。有1个聚合口,1个管理接口(Meth0/0/1),1个Console接口(Console 9/0/0),1个环回口(Loopback 0),1个伪接口(Null 0),Vlanif1接口,Vlanxxxx接口(该Vlan为管理Vlan),48个TenGigabitethernet接口与2个40Gigabitethernet接口,加上Template Module Generic SNMPv2: General、(Template Module EtherLike-MIB SNMPv2,Template Module interfaces SNMPv2:Network interfaces)、Template Module ICMP Ping: Status,共59个。
笔者在上一篇文章上有提到模板Template Net Huawei VRP SNMP,但该模板并未提到有关接口的应用集以及监控项。简单研究用于监控数通设备的Zabbix模板“Template Net Huawei VRP SNMP”_筐瓢大师小吕的博客-CSDN博客
但我们可以发现该设备存在有两个自动发现规则,他们位于Template Module EtherLike-MIB SNMP与Template Module Interfaces SNMP模板中,这里先写Template Module Interfaces SNMP。
关于自动发现的规则,笔者将结合上一篇文章一起进行实验,此处先查看该自动发现的监控项原型及触发器。
模板Template Module Interfaces SNMP监控项原型:
①
名称:Interface {#IFNAME}({#IFALIAS}): Bits received
键值:net.if.in[ifHCInOctets.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.31.1.1.1.6.{#SNMPINDEX}
描述:MIB: IF-MIB
The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifInOctets. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
②
名称:Interface {#IFNAME}({#IFALIAS}): Bits sent
键值:net.if.out[ifHCOutOctets.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.31.1.1.1.10.{#SNMPINDEX}
描述:MIB: IF-MIB
The total number of octets transmitted out of the interface, including framing characters. This object is a 64-bit version of ifOutOctets.Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
③
名称:Interface {#IFNAME}({#IFALIAS}): Inbound packets discarded
键值:net.if.in.discards[ifInDiscards.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.2.2.1.13.{#SNMPINDEX}
描述:MIB: IF-MIB
The number of inbound packets which were chosen to be discarded
even though no errors had been detected to prevent their being deliverable to a higher-layer protocol.
One possible reason for discarding such a packet could be to free up buffer space.
Discontinuities in the value of this counter can occur at re-initialization of the management system,
and at other times as indicated by the value of ifCounterDiscontinuityTime.
④
名称:Interface {#IFNAME}({#IFALIAS}): Inbound packets with errors
键值:net.if.in.errors[ifInErrors.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.2.2.1.14.{#SNMPINDEX}
描述:MIB: IF-MIB
For packet-oriented interfaces, the number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of inbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
⑤
名称:Interface {#IFNAME}({#IFALIAS}): Interface type
键值:net.if.type[ifType.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.2.2.1.3.{#SNMPINDEX}
描述:MIB: IF-MIB
The type of interface.
Additional values for ifType are assigned by the Internet Assigned NumbersAuthority (IANA),
through updating the syntax of the IANAifType textual convention.
⑥
名称:Interface {#IFNAME}({#IFALIAS}): Operational status
键值:net.if.status[ifOperStatus.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.2.2.1.8.{#SNMPINDEX}
描述:MIB: IF-MIB
The current operational state of the interface.
- The testing(3) state indicates that no operational packet scan be passed
- If ifAdminStatus is down(2) then ifOperStatus should be down(2)
- If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic
- It should change todormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection)
- It should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state
- It should remain in the notPresent(6) state if the interface has missing(typically, hardware) components.
⑦
名称:Interface {#IFNAME}({#IFALIAS}): Outbound packets discarded
键值:net.if.out.discards[ifOutDiscards.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.2.2.1.19.{#SNMPINDEX}
描述:MIB: IF-MIB
The number of outbound packets which were chosen to be discarded
even though no errors had been detected to prevent their being deliverable to a higher-layer protocol.
One possible reason for discarding such a packet could be to free up buffer space.
Discontinuities in the value of this counter can occur at re-initialization of the management system,
and at other times as indicated by the value of ifCounterDiscontinuityTime.
⑧
名称:Interface {#IFNAME}({#IFALIAS}): Outbound packets with errors
键值:net.if.out.errors[ifOutErrors.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.2.2.1.20.{#SNMPINDEX}
描述:MIB: IF-MIB
For packet-oriented interfaces, the number of outbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of outbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.
⑨
名称:Interface {#IFNAME}({#IFALIAS}): Speed
键值:net.if.speed[ifHighSpeed.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.31.1.1.1.15.{#SNMPINDEX}
描述:MIB: IF-MIB
An estimate of the interface's current bandwidth in units of 1,000,000 bits per second. If this object reports a value of `n' then the speed of the interface is somewhere in the range of `n-500,000' to`n+499,999'. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. For a sub-layer which has no concept of bandwidth, this object should be zero.
简单来说,该模板用于监控接口的接收速率、发送速率、丢弃的包数量(入方向)、错误包数量(入方向)、接口类型、当前状态、丢弃的包数量(出方向)、错误包数量(出方向)、端口速率。
模板Template Module EtherLike-MIB SNMP监控项原型:
名称:Interface {#IFNAME}({#IFALIAS}): Duplex status
键值:net.if.duplex[dot3StatsDuplexStatus.{#SNMPINDEX}]
SNMP OID:1.3.6.1.2.1.10.7.2.1.19.{#SNMPINDEX}
描述:
MIB: EtherLike-MIB
The current mode of operation of the MAC entity. 'unknown' indicates that the current
duplex mode could not be determined.
Management control of the duplex mode is accomplished through the MAU MIB. When
an interface does not support autonegotiation,or when autonegotiation is not enabled, the
duplex mode is controlled using ifMauDefaultType. When autonegotiation is supported and enabled, duplex mode is controlled using ifMauAutoNegAdvertisedBits. In either case, the currently operating duplex mode is reflected both in this object and in ifMauType.
Note that this object provides redundant information with ifMauType. Normally, redundant objects are discouraged. However, in this instance, it allows a management application to determine the duplex status of an interface without having to know every possible value of ifMauType. This was felt to be sufficiently valuable to justify the redundancy.
Reference: [IEEE 802.3 Std.], 30.3.1.1.32,aDuplexStatus.
该模板主要用于监控接口的双工状态。
如上两个模板的大多参数,实际上可以在设备上通过display interface Gigabitethernet0/0/x囊括。
在下一篇实验中逐一验证。