From 850e8f1c68101bca3c2a24aba890a77ce3f6f173 Mon Sep 17 00:00:00 2001 From: Yuwei Ba Date: Mon, 4 Sep 2023 01:40:39 +1000 Subject: [PATCH] Add net-snmp IP-MIB (#679) To walk https://oidref.com/1.3.6.1.2.1.4.20 This can be useful when walking IP address of interfaces Signed-off-by: Yuwei B --- generator/Makefile | 1 + generator/generator.yml | 5 ++++- snmp.yml | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/generator/Makefile b/generator/Makefile index e3084d5a..75905407 100644 --- a/generator/Makefile +++ b/generator/Makefile @@ -219,6 +219,7 @@ $(MIBDIR)/.net-snmp: @curl $(CURL_OPTS) -o $(MIBDIR)/HCNUM-TC $(NET_SNMP_URL)/HCNUM-TC.txt @curl $(CURL_OPTS) -o $(MIBDIR)/HOST-RESOURCES-MIB $(NET_SNMP_URL)/HOST-RESOURCES-MIB.txt @curl $(CURL_OPTS) -o $(MIBDIR)/IF-MIB $(NET_SNMP_URL)/IF-MIB.txt + @curl $(CURL_OPTS) -o $(MIBDIR)/IP-MIB $(NET_SNMP_URL)/IP-MIB.txt @curl $(CURL_OPTS) -o $(MIBDIR)/INET-ADDRESS-MIB $(NET_SNMP_URL)/INET-ADDRESS-MIB.txt @curl $(CURL_OPTS) -o $(MIBDIR)/IPV6-TC $(NET_SNMP_URL)/IPV6-TC.txt @curl $(CURL_OPTS) -o $(MIBDIR)/NET-SNMP-MIB $(NET_SNMP_URL)/NET-SNMP-MIB.txt diff --git a/generator/generator.yml b/generator/generator.yml index a3fdd2c8..be2b490b 100644 --- a/generator/generator.yml +++ b/generator/generator.yml @@ -27,7 +27,10 @@ modules: ignore: true # Lookup metric ifType: type: EnumAsInfo - + # Default IP-MIB with ipv4InterfaceTable for example. + ip_mib: + walk: [ipv4InterfaceTable] + # Cisco Wireless LAN Controller cisco_wlc: walk: diff --git a/snmp.yml b/snmp.yml index a22816ba..070bc2ab 100644 --- a/snmp.yml +++ b/snmp.yml @@ -7774,6 +7774,45 @@ modules: regex: ^(?:(\d*?)(\d{2}))$ - value: 0.0$1 regex: ^(?:^(\d))$ + ip_mib: + walk: + - 1.3.6.1.2.1.4.28 + metrics: + - name: ipv4InterfaceIfIndex + oid: 1.3.6.1.2.1.4.28.1.1 + type: gauge + help: The index value that uniquely identifies the interface to which this entry + is applicable - 1.3.6.1.2.1.4.28.1.1 + indexes: + - labelname: ipv4InterfaceIfIndex + type: gauge + - name: ipv4InterfaceReasmMaxSize + oid: 1.3.6.1.2.1.4.28.1.2 + type: gauge + help: The size of the largest IPv4 datagram that this entity can re-assemble + from incoming IPv4 fragmented datagrams received on this interface. - 1.3.6.1.2.1.4.28.1.2 + indexes: + - labelname: ipv4InterfaceIfIndex + type: gauge + - name: ipv4InterfaceEnableStatus + oid: 1.3.6.1.2.1.4.28.1.3 + type: gauge + help: The indication of whether IPv4 is enabled (up) or disabled (down) on this + interface - 1.3.6.1.2.1.4.28.1.3 + indexes: + - labelname: ipv4InterfaceIfIndex + type: gauge + enum_values: + 1: up + 2: down + - name: ipv4InterfaceRetransmitTime + oid: 1.3.6.1.2.1.4.28.1.4 + type: gauge + help: The time between retransmissions of ARP requests to a neighbor when resolving + the address or when probing the reachability of a neighbor. - 1.3.6.1.2.1.4.28.1.4 + indexes: + - labelname: ipv4InterfaceIfIndex + type: gauge keepalived: walk: - 1.3.6.1.2.1.207.1.2.5