Skip to content

Commit

Permalink
Bastischubert/add tplink ddm (#1304)
Browse files Browse the repository at this point in the history
* added tplink switches digital diagnostics monitoring

Signed-off-by: Sebastian Schubert <[email protected]>

* added additional meta info for the module

Signed-off-by: Sebastian Schubert <[email protected]>

---------

Signed-off-by: Sebastian Schubert <[email protected]>
  • Loading branch information
bastischubert authored Nov 30, 2024
1 parent aa5edcf commit f166e4d
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 0 deletions.
12 changes: 12 additions & 0 deletions generator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -84,6 +85,7 @@ clean:
$(MIBDIR)/.synology \
$(MIBDIR)/.sophos_xg \
$(MIBDIR)/.kemp-lm \
$(MIBDIR)/.tplinkddm \
$(MIBDIR)/readynas \
$(MIBDIR)/readydataos

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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"
Expand Down
68 changes: 68 additions & 0 deletions generator/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
172 changes: 172 additions & 0 deletions snmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f166e4d

Please sign in to comment.