Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Dlink dgs-1250-28x #15734

Merged
merged 1 commit into from Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
175 changes: 175 additions & 0 deletions includes/definitions/discovery/dlink-dgs1250.yaml
@@ -0,0 +1,175 @@
mib: DLINKSW-ENTITY-EXT-MIB:DLINKSW-DDM-MIB
modules:
os:
hardware: SNMPv2-MIB::sysDescr.0
version:
- DLINKSW-ENTITY-EXT-MIB::dEntityExtVersionRuntime.1
serial:
- ENTITY-MIB::entPhysicalSerialNum.1
processors:
data:
-
oid: DLINKSW-ENTITY-EXT-MIB::dEntityExtCpuUtilTable
value: DLINKSW-ENTITY-EXT-MIB::dEntityExtCpuUtilFiveMinutes.1.1
num_oid: '.1.3.6.1.4.1.171.11.165.1000.5.1.7.1.5.1.1'
mempools:
data:
-
oid: DLINKSW-ENTITY-EXT-MIB::dEntityExtMemoryUtilTable
total: DLINKSW-ENTITY-EXT-MIB::dEntityExtMemUtilTotal
used: DLINKSW-ENTITY-EXT-MIB::dEntityExtMemUtilUsed
free: DLINKSW-ENTITY-EXT-MIB::dEntityExtMemUtilFree
descr: '{{ $subindex1 }} Memory'
precision: 1024
sensors:
temperature:
data:
-
oid: dEntityExtEnvTempTable
value: dEntityExtEnvTempCurrent
num_oid: '.1.3.6.1.4.1.171.11.165.1000.5.1.1.1.1.4.{{ $index }}'
descr: dEntityExtEnvTempDescr
index: 'dEntityExtEnvTempCurrent.{{ $index }}'
low_limit: dEntityExtEnvTempThresholdLow
high_limit: dEntityExtEnvTempThresholdHigh
-
oid: dDdmIfInfoTable
value: dDdmIfInfoCurrentTemperature
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.1.{{ $index }}'
descr: 'SFP {{ $index }} Temp'
index: 'dDdmIfInfoCurrentTemperature.{{ $index }}'
low_limit: dDdmIfInfoLowAlarmTemperature
high_limit: dDdmIfInfoHighAlarmTemperature
divisor: 1000
voltage:
data:
-
oid: dDdmIfInfoTable
value: dDdmIfInfoCurrentVoltage
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.7.{{ $index }}'
descr: 'SFP {{ $index }} Volt'
index: 'dDdmIfInfoCurrentVoltage.{{ $index }}'
low_limit: dDdmIfInfoHighAlarmVoltage
high_limit: dDdmIfInfoLowAlarmVoltage
divisor: 100
current:
data:
-
oid: dDdmIfInfoTable
value: dDdmIfInfoCurrentBiasCurrent
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.13.{{ $index }}'
descr: 'SFP {{ $index }} Bias'
index: 'dDdmIfInfoCurrentBiasCurrent.{{ $index }}'
low_limit: dDdmIfInfoHighAlarmBiasCurrent
high_limit: dDdmIfInfoLowAlarmBiasCurrent
divisor: 1000
power:
data:
-
oid: dDdmIfInfoTable
value: dDdmIfInfoCurrentTxPower
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.19.{{ $index }}'
descr: 'SFP {{ $index }} TX Power'
index: ' dDdmIfInfoCurrentTxPower.{{ $index }}'
low_limit: dDdmIfInfoHighAlarmTxPower
high_limit: dDdmIfInfoLowAlarmTxPower
divisor: 1000000
-
oid: dDdmIfInfoTable
value: dDdmIfInfoCurrentRxPower
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.25.{{ $index }}'
descr: 'SFP {{ $index }} RX Power'
index: ' dDdmIfInfoCurrentRxPower.{{ $index }}'
low_limit: dDdmIfInfoHighAlarmRxPower
high_limit: dDdmIfInfoLowAlarmRxPower
divisor: 1000000
state:
data:
-
oid: dEntityExtEnvFanTable
value: dEntityExtEnvFanStatus
num_oid: '.1.3.6.1.4.1.171.11.165.1000.5.1.1.2.1.4.{{ $index }}'
descr: dEntityExtEnvFanDescr
index: 'dEntityExtEnvFanStatus.{{ $index }}'
states:
- { descr: Ok, graph: 1, value: 1, generic: 0 }
- { descr: Fault, graph: 1, value: 2, generic: 2 }
-
oid: dEntityExtEnvPowerTable
value: dEntityExtEnvPowerStatus
num_oid: '.1.3.6.1.4.1.171.11.165.1000.5.1.1.3.1.6.{{ $index }}'
descr: dEntityExtEnvPowerDescr
index: 'dEntityExtEnvPowerStatus.{{ $index }}'
states:
- { descr: In Operation, graph: 1, value: 1, generic: 0 }
- { descr: Failed, graph: 1, value: 2, generic: 2 }
- { descr: Empty, graph: 1, value: 3, generic: 3 }
-
oid: dEntityExtEnvTempTable
value: dEntityExtEnvTempStatus
num_oid: '.1.3.6.1.4.1.171.11.165.1000.5.1.1.1.1.7.{{ $index }}'
descr: dEntityExtEnvTempDescr
index: 'dEntityExtEnvTempStatus.{{ $index }}'
states:
- { descr: Ok, graph: 1, value: 1, generic: 0 }
- { descr: Abnormal, graph: 1, value: 2, generic: 2 }
-
oid: dDdmIfInfoTable
value: dDdmIfInfoTemperatureState
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.2.{{ $index }}'
descr: 'SFP {{ $index }} Temp'
index: 'dDdmIfInfoTemperatureState.{{ $index }}'
states:
- { descr: Normal, graph: 1, value: 0, generic: 0 }
- { descr: HiAlarm, graph: 1, value: 1, generic: 2 }
- { descr: HiWarning, graph: 1, value: 2, generic: 1 }
- { descr: LoWarning, graph: 1, value: 3, generic: 1 }
- { descr: LoAlarm, graph: 1, value: 4, generic: 2 }
-
oid: dDdmIfInfoTable
value: dDdmIfInfoVoltageState
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.8.{{ $index }}'
descr: 'SFP {{ $index }} Voltage'
index: 'dDdmIfInfoVoltageState.{{ $index }}'
states:
- { descr: Normal, graph: 1, value: 0, generic: 0 }
- { descr: HiAlarm, graph: 1, value: 1, generic: 2 }
- { descr: HiWarning, graph: 1, value: 2, generic: 1 }
- { descr: LoWarning, graph: 1, value: 3, generic: 1 }
- { descr: LoAlarm, graph: 1, value: 4, generic: 2 }
-
oid: dDdmIfInfoTable
value: dDdmIfInfoBiasCurrentState
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.14.{{ $index }}'
descr: 'SFP {{ $index }} Bias'
index: 'dDdmIfInfoBiasCurrentState.{{ $index }}'
states:
- { descr: Normal, graph: 1, value: 0, generic: 0 }
- { descr: HiAlarm, graph: 1, value: 1, generic: 2 }
- { descr: HiWarning, graph: 1, value: 2, generic: 1 }
- { descr: LoWarning, graph: 1, value: 3, generic: 1 }
- { descr: LoAlarm, graph: 1, value: 4, generic: 2 }
-
oid: dDdmIfInfoTable
value: dDdmIfInfoTxPowerState
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.20.{{ $index }}'
descr: 'SFP {{ $index }} TX Power'
index: 'dDdmIfInfoTxPowerState.{{ $index }}'
states:
- { descr: Normal, graph: 1, value: 0, generic: 0 }
- { descr: HiAlarm, graph: 1, value: 1, generic: 2 }
- { descr: HiWarning, graph: 1, value: 2, generic: 1 }
- { descr: LoWarning, graph: 1, value: 3, generic: 1 }
- { descr: LoAlarm, graph: 1, value: 4, generic: 2 }
-
oid: dDdmIfInfoTable
value: dDdmIfInfoRxPowerState
num_oid: '.1.3.6.1.4.1.171.11.165.1000.72.1.4.1.1.26.{{ $index }}'
descr: 'SFP {{ $index }} RX Power'
index: 'dDdmIfInfoRxPowerState.{{ $index }}'
states:
- { descr: Normal, graph: 1, value: 0, generic: 0 }
- { descr: HiAlarm, graph: 1, value: 1, generic: 2 }
- { descr: HiWarning, graph: 1, value: 2, generic: 1 }
- { descr: LoWarning, graph: 1, value: 3, generic: 1 }
- { descr: LoAlarm, graph: 1, value: 4, generic: 2 }
15 changes: 15 additions & 0 deletions includes/definitions/dlink-dgs1250.yaml
@@ -0,0 +1,15 @@
os: dlink-dgs1250
text: 'D-Link Switch'
type: network
icon: dlink
#group: dlink
mib_dir: dlink_dgs1250
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the "mib_dir: dlink" to use the existing MIB files. If needed, upgrade them (or add missing ones)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @PipoCanaja
separated OS named dlink-dgs1250 was added because MIB files needed for this switch are not equal with existing MIB files. OIDs are resolved/translated differently. I could NOT add these MIB files in existing DLINK folder, because they have same name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you show us the differences between existing and new ones ? Depending how bad it is, we could solve it in a single OS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you show us the differences between existing and new ones ? Depending how bad it is, we could solve it in a single OS.

hope it will be enough
part of sensor discovery with standard dlink mibs

Caching data: os processors SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUSa' '-Ih' '-m' 'DLINKSW-ENTITY-EXT-MIB:DLINKSW-DDM-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/dlink' 'udp:HOSTNAME:5001' 'DLINKSW-ENTITY-EXT-MIB::dEntityExtCpuUtilTable']
DLINKSW-ENTITY-EXT-MIB::dEntityExtCpuUtilTable = No Such Instance currently exists at this OID  
  
Invalid snmp_walk() data = DLINKSW-ENTITY-EXT-MIB::dEntityExtCpuUtilTable = No Such Instance currently exists at this OID  
mempools SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUSa' '-Ih' '-m' 'DLINKSW-ENTITY-EXT-MIB:DLINKSW-DDM-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/dlink' 'udp:HOSTNAME:5001' 'DLINKSW-ENTITY-EXT-MIB::dEntityExtMemoryUtilTable']
DLINKSW-ENTITY-EXT-MIB::dEntityExtMemoryUtilTable = No Such Instance currently exists at this OID  
  
Invalid snmp_walk() data = DLINKSW-ENTITY-EXT-MIB::dEntityExtMemoryUtilTable = No Such Instance currently exists at this OID  
sensors SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUsa' '-Ih' '-m' 'DLINKSW-ENTITY-EXT-MIB:DLINKSW-DDM-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/dlink' 'udp:HOSTNAME:5001' 'dEntityExtEnvTempTable']
dEntityExtEnvTempTable = No Such Instance currently exists at this OID  
  
Invalid snmp_walk() data = dEntityExtEnvTempTable = No Such Instance currently exists at this OID  
SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUsa' '-Ih' '-m' 'DLINKSW-ENTITY-EXT-MIB:DLINKSW-DDM-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/dlink' 'udp:HOSTNAME:5001' 'dDdmIfInfoTable']
dDdmIfInfoTable = No Such Instance currently exists at this OID  
  
Invalid snmp_walk() data = dDdmIfInfoTable = No Such Instance currently exists at this OID  
SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUsa' '-Ih' '-m' 'DLINKSW-ENTITY-EXT-MIB:DLINKSW-DDM-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/dlink' 'udp:HOSTNAME:5001' 'dEntityExtEnvFanTable']
dEntityExtEnvFanTable = No Such Instance currently exists at this OID  
  
Invalid snmp_walk() data = dEntityExtEnvFanTable = No Such Instance currently exists at this OID  
SNMP['/usr/bin/snmpbulkwalk' '-v2c' '-c' 'COMMUNITY' '-OteQUsa' '-Ih' '-m' 'DLINKSW-ENTITY-EXT-MIB:DLINKSW-DDM-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/dlink' 'udp:HOSTNAME:5001' 'dEntityExtEnvPowerTable']
dEntityExtEnvPowerTable = No Such Instance currently exists at this OID

ifname: true
empty_ifdescr: false
discovery:
-
sysObjectID:
- .1.3.6.1.4.1.171.10.165.1.1
good_if:
- po
- vlan
61 changes: 61 additions & 0 deletions mibs/dlink_dgs1250/DLINK-ID-REC-MIB
@@ -0,0 +1,61 @@
-- D-Link Common MIBs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the files in the standard dlink mib directory instead of creating a new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @PipoCanaja
separated OS named dlink-dgs1250 was added because MIB files needed for this switch are not equal with existing MIB files. OIDs are resolved/translated differently. I could NOT add these MIB files in existing DLINK folder, because they have same name

-- DLINK-ID-REC
-- -----------------------------------------------------------------------------
-- Version 1.5
-- 2018/11/01
-- Add dlink-DGS-1250SeriesProj and dlink-dgs-1250-Common
-- by Wendy Hsueh
-- -----------------------------------------------------------------------------
-- Version 1.4
-- 2012/6/19
-- Add dlinkIndustrialCommon
-- by Jane Peng
-- -----------------------------------------------------------------------------
-- Version 1.3
-- 2009/1/15
-- Modify syntax of AgentNotifyLevel
-- for support 8 notification levels.
-- by Green Zhu
-- -----------------------------------------------------------------------------
-- Version 1.2
-- 2008/8/11
-- Add dlink-broadband-products and dlink-broadband-mgmt.
-- by Green Zhu
-- -----------------------------------------------------------------------------
-- Version 1.1
-- 2004/7/6
-- Modify syntax of AgentNotifyLevel
-- by Karen
-- -----------------------------------------------------------------------------
-- Version 1.0.12 01-29-2002
-- -----------------------------------------------------------------------------
DLINK-ID-REC-MIB DEFINITIONS ::= BEGIN
IMPORTS
enterprises FROM RFC1155-SMI;


AgentNotifyLevel ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"Notification leveling."
SYNTAX INTEGER {
critical(0),
warning(1),
information(2),
emergency(3),
alert(4),
error(5),
notice(6),
debug(7)
}

dlink OBJECT IDENTIFIER ::= { enterprises 171 }
dlink-products OBJECT IDENTIFIER ::= { dlink 10 }
dlink-mgmt OBJECT IDENTIFIER ::= { dlink 11 }
dlink-common-mgmt OBJECT IDENTIFIER ::= { dlink 12 }
dlinkIndustrialCommon OBJECT IDENTIFIER ::= { dlink 14 }
dlink-broadband-products OBJECT IDENTIFIER ::= { dlink 30 }
dlink-broadband-mgmt OBJECT IDENTIFIER ::= { dlink 31 }
dlink-DGS-1250SeriesProj OBJECT IDENTIFIER ::= { dlink-mgmt 165 }
dlink-dgs-1250-Common OBJECT IDENTIFIER ::= { dlink-DGS-1250SeriesProj 1000 }
END