From f166e4d7a86f4a0e4ceb052f9637e85950e097b1 Mon Sep 17 00:00:00 2001 From: bastischubert <16682281+bastischubert@users.noreply.github.com> Date: Sat, 30 Nov 2024 15:32:20 +0100 Subject: [PATCH] Bastischubert/add tplink ddm (#1304) * added tplink switches digital diagnostics monitoring Signed-off-by: Sebastian Schubert * added additional meta info for the module Signed-off-by: Sebastian Schubert --------- Signed-off-by: Sebastian Schubert --- generator/Makefile | 12 +++ generator/generator.yml | 68 ++++++++++++++++ snmp.yml | 172 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 252 insertions(+) diff --git a/generator/Makefile b/generator/Makefile index 82940712..72ad84d3 100644 --- a/generator/Makefile +++ b/generator/Makefile @@ -62,6 +62,7 @@ READYNAS_URL := https://www.downloads.netgear.com/files/ReadyNAS/READYNAS-M READYDATAOS_URL := https://www.downloads.netgear.com/files/GDC/RD5200/READYDATA_MIB.zip SOPHOS_XG_URL := https://docs.sophos.com/nsg/sophos-firewall/MIB/SOPHOS-XG-MIB.zip POWERCOM_URL := https://www.upspowercom.com/pcm-img/Card-DA807/Upsmate_PCM.mib +TPLINK_DDM := https://static.tp-link.com/upload/software/2024/202402/20240229/L2-tplinkMibs.zip CYBERPOWER_VERSION := 2.11 CYBERPOWER_URL := https://dl4jz3rbrsfum.cloudfront.net/software/CyberPower_MIB_v$(CYBERPOWER_VERSION).MIB.zip @@ -84,6 +85,7 @@ clean: $(MIBDIR)/.synology \ $(MIBDIR)/.sophos_xg \ $(MIBDIR)/.kemp-lm \ + $(MIBDIR)/.tplinkddm \ $(MIBDIR)/readynas \ $(MIBDIR)/readydataos @@ -146,6 +148,7 @@ mibs: \ $(MIBDIR)/servertech-sentry4-mib \ $(MIBDIR)/.synology \ $(MIBDIR)/.sophos_xg \ + $(MIBDIR)/.tplinkddm \ $(MIBDIR)/UBNT-UniFi-MIB \ $(MIBDIR)/UBNT-AirFiber-MIB \ $(MIBDIR)/UBNT-AirMAX-MIB.txt \ @@ -326,6 +329,15 @@ $(MIBDIR)/.synology: @rm -v $(TMP) @touch $(MIBDIR)/.synology +$(MIBDIR)/.tplinkddm: + $(eval TMP := $(shell mktemp)) + @echo ">> Downloading TPLINK Switch DDM to $(TMP)" + @curl $(CURL_OPTS) -o $(TMP) $(TPLINK_DDM) + @unzip -j -d $(MIBDIR) $(TMP) L2-tplinkMibs/tplink-ddmManage.mib L2-tplinkMibs/tplink-ddmStatus.mib L2-tplinkMibs/tplink.mib + @mv $(MIBDIR)/tplink.mib $(MIBDIR)/tplink-main.mib # EAP.MIB contains another incompatible variant of the tplink enterprise mib with same name + @rm -v $(TMP) + @touch $(MIBDIR)/.tplinkddm + $(MIBDIR)/UBNT-UniFi-MIB: @echo ">> Downloading UBNT-UniFi-MIB" @curl $(CURL_OPTS) -o $(MIBDIR)/UBNT-UniFi-MIB "$(UBNT_DL_URL)/UBNT-UniFi-MIB" diff --git a/generator/generator.yml b/generator/generator.yml index d8c83b89..5864318b 100644 --- a/generator/generator.yml +++ b/generator/generator.yml @@ -837,3 +837,71 @@ modules: - 1.3.6.1.4.1.935.1.1.1.9.2.2 # upsEnvUnderTemperature - 1.3.6.1.4.1.935.1.1.1.9.2.3 # upsEnvOverHumidity - 1.3.6.1.4.1.935.1.1.1.9.2.4 # upsEnvUnderHumidity + + # tplink ddm information for sfps + # + # Downloads can be found here: + # https://www.tp-link.com/en/support/download/tl-sg3428x/ + # + # tested against TL SG3428X + tplink-ddm: + walk: + - ddmStatusBiasCurrent + - ddmStatusLossSignal + - ddmStatusRxPow + - ddmStatusTemperature + - ddmStatusTxFault + - ddmStatusTxPow + - ddmStatusVoltage + lookups: + - source_indexes: [ifIndex] + lookup: ifAlias + - source_indexes: [ifIndex] + lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName + overrides: + ddmStatusBiasCurrent: + type: DisplayString + regex_extracts: + '': + - regex: '^(\d+\.\d+).*' + value: '$1' + ddmStatusLossSignal: + type: DisplayString + regex_extracts: + '': + - regex: 'False' + value: '0' + - regex: 'True' + value: '1' + ddmStatusRxPow: + type: DisplayString + regex_extracts: + '': + - regex: '^(\d+\.\d+).*' + value: '$1' + ddmStatusTemperature: + type: DisplayString + regex_extracts: + '': + - regex: '^(\d+\.\d+).*' + value: '$1' + ddmStatusTxFault: + type: DisplayString + regex_extracts: + '': + - regex: 'False' + value: '0' + - regex: 'True' + value: '1' + ddmStatusTxPow: + type: DisplayString + regex_extracts: + '': + - regex: '^(\d+\.\d+).*' + value: '$1' + ddmStatusVoltage: + type: DisplayString + regex_extracts: + '': + - regex: '^(\d+\.\d+).*' + value: '$1' diff --git a/snmp.yml b/snmp.yml index 9c63b74f..6a006d5f 100644 --- a/snmp.yml +++ b/snmp.yml @@ -39829,6 +39829,178 @@ modules: type: DisplayString - labels: [] labelname: serviceInfoIndex + tplink-ddm: + walk: + - 1.3.6.1.2.1.31.1.1.1.1 + - 1.3.6.1.2.1.31.1.1.1.18 + - 1.3.6.1.4.1.11863.6.96.1.7.1.1.2 + - 1.3.6.1.4.1.11863.6.96.1.7.1.1.3 + - 1.3.6.1.4.1.11863.6.96.1.7.1.1.4 + - 1.3.6.1.4.1.11863.6.96.1.7.1.1.5 + - 1.3.6.1.4.1.11863.6.96.1.7.1.1.6 + - 1.3.6.1.4.1.11863.6.96.1.7.1.1.8 + - 1.3.6.1.4.1.11863.6.96.1.7.1.1.9 + metrics: + - name: ddmStatusTemperature + oid: 1.3.6.1.4.1.11863.6.96.1.7.1.1.2 + type: DisplayString + help: This object indicates the temperature of the port. - 1.3.6.1.4.1.11863.6.96.1.7.1.1.2 + indexes: + - labelname: ifIndex + type: gauge + lookups: + - labels: + - ifIndex + labelname: ifAlias + oid: 1.3.6.1.2.1.31.1.1.1.18 + type: DisplayString + - labels: + - ifIndex + labelname: ifName + oid: 1.3.6.1.2.1.31.1.1.1.1 + type: DisplayString + regex_extracts: + "": + - value: $1 + regex: ^(?:^(\d+\.\d+).*)$ + - name: ddmStatusVoltage + oid: 1.3.6.1.4.1.11863.6.96.1.7.1.1.3 + type: DisplayString + help: This object indicates the voltage of the port. - 1.3.6.1.4.1.11863.6.96.1.7.1.1.3 + indexes: + - labelname: ifIndex + type: gauge + lookups: + - labels: + - ifIndex + labelname: ifAlias + oid: 1.3.6.1.2.1.31.1.1.1.18 + type: DisplayString + - labels: + - ifIndex + labelname: ifName + oid: 1.3.6.1.2.1.31.1.1.1.1 + type: DisplayString + regex_extracts: + "": + - value: $1 + regex: ^(?:^(\d+\.\d+).*)$ + - name: ddmStatusBiasCurrent + oid: 1.3.6.1.4.1.11863.6.96.1.7.1.1.4 + type: DisplayString + help: This object indicates the bias current of the port. - 1.3.6.1.4.1.11863.6.96.1.7.1.1.4 + indexes: + - labelname: ifIndex + type: gauge + lookups: + - labels: + - ifIndex + labelname: ifAlias + oid: 1.3.6.1.2.1.31.1.1.1.18 + type: DisplayString + - labels: + - ifIndex + labelname: ifName + oid: 1.3.6.1.2.1.31.1.1.1.1 + type: DisplayString + regex_extracts: + "": + - value: $1 + regex: ^(?:^(\d+\.\d+).*)$ + - name: ddmStatusTxPow + oid: 1.3.6.1.4.1.11863.6.96.1.7.1.1.5 + type: DisplayString + help: This object indicates the tx power of the port. - 1.3.6.1.4.1.11863.6.96.1.7.1.1.5 + indexes: + - labelname: ifIndex + type: gauge + lookups: + - labels: + - ifIndex + labelname: ifAlias + oid: 1.3.6.1.2.1.31.1.1.1.18 + type: DisplayString + - labels: + - ifIndex + labelname: ifName + oid: 1.3.6.1.2.1.31.1.1.1.1 + type: DisplayString + regex_extracts: + "": + - value: $1 + regex: ^(?:^(\d+\.\d+).*)$ + - name: ddmStatusRxPow + oid: 1.3.6.1.4.1.11863.6.96.1.7.1.1.6 + type: DisplayString + help: This object indicates the rx power of the port. - 1.3.6.1.4.1.11863.6.96.1.7.1.1.6 + indexes: + - labelname: ifIndex + type: gauge + lookups: + - labels: + - ifIndex + labelname: ifAlias + oid: 1.3.6.1.2.1.31.1.1.1.18 + type: DisplayString + - labels: + - ifIndex + labelname: ifName + oid: 1.3.6.1.2.1.31.1.1.1.1 + type: DisplayString + regex_extracts: + "": + - value: $1 + regex: ^(?:^(\d+\.\d+).*)$ + - name: ddmStatusLossSignal + oid: 1.3.6.1.4.1.11863.6.96.1.7.1.1.8 + type: DisplayString + help: This object indicates whether local SFP reports signal loss or not. - + 1.3.6.1.4.1.11863.6.96.1.7.1.1.8 + indexes: + - labelname: ifIndex + type: gauge + lookups: + - labels: + - ifIndex + labelname: ifAlias + oid: 1.3.6.1.2.1.31.1.1.1.18 + type: DisplayString + - labels: + - ifIndex + labelname: ifName + oid: 1.3.6.1.2.1.31.1.1.1.1 + type: DisplayString + regex_extracts: + "": + - value: "0" + regex: ^(?:False)$ + - value: "1" + regex: ^(?:True)$ + - name: ddmStatusTxFault + oid: 1.3.6.1.4.1.11863.6.96.1.7.1.1.9 + type: DisplayString + help: This object indicates whether remote SFP reports signal loss or not. - + 1.3.6.1.4.1.11863.6.96.1.7.1.1.9 + indexes: + - labelname: ifIndex + type: gauge + lookups: + - labels: + - ifIndex + labelname: ifAlias + oid: 1.3.6.1.2.1.31.1.1.1.18 + type: DisplayString + - labels: + - ifIndex + labelname: ifName + oid: 1.3.6.1.2.1.31.1.1.1.1 + type: DisplayString + regex_extracts: + "": + - value: "0" + regex: ^(?:False)$ + - value: "1" + regex: ^(?:True)$ ubiquiti_airfiber: walk: - 1.3.6.1.4.1.41112.1.3