D-Link MIBs this is biggest shit from all possible.

It uses separate OID tree (and separate MIBs) for each device model.
Some time it changes OID tree and MIB file for newer firmware ( incompatible with the previous).

All 1210 models as example...

I need snmp access to real device, for check code.
Without access, nothing will be added..


On 09.02.16 14:06, Dirk-Willem van Gulik wrote:
On 09 Feb 2016, at 11:37, Mike Stupalov <mike@observium.org> wrote:

 you have MIB files for this D-Link models?
I see you use DGS-1210-28P-CX..
D-Link is quite good at putting all their files up; e.g for that model - see

	http://ftp.dlink.ru/pub/Switch/DGS-1210-28P/SNMP

or the relevant URL for your country.  Not all of those are part of Observium.

Couple of things

-	you want to check them with snmptranslate/smilint - as most:

	-	contain non ASCII chars that make net-snmp choke.

	-	contain malformed comments or reserved words like
		‘end’ and ‘revision’ in places that confuse net-snmp.

	So easiest is to move the declaration to line 1; remove
	the first comment block (at least the lines with Revision and
	Revision End) - and padd out any lines with an extra ‘-‘
	if they give complaints. And do a quick iconv or regex
	to remove any non-ascii and \r characters.

-	D-Link unfortunately is a bit messy - and reuses the same
	structure; but ‘under’ each switch its OID.

	So the sysPortDescString for the various switches is
	a unique OID whose tail end is identical - but the product
	path is not!. I use below script for things like this.

Dw.

searching for sysPortDescString in DES-1210-10-AXME
.iso.org.dod.internet.private.enterprises.d-link.dlink-products.dlink-DES1210SeriesProd.des-1210-10axme.companySystem.sysPortDescriptionTable.sysPortDescriptionEntry.sysPortDescString
.1.3.6.1.4.1.171.10.75.14.1.14.1.3

searching for sysPortDescString in DES-1210-10MEbx
.iso.org.dod.internet.private.enterprises.d-link.dlink-products.dlink-DES1210SeriesProd.des-1210-10me.des-1210-10mebx.companySystem.sysPortDescriptionTable.sysPortDescriptionEntry.sysPortDescString
.1.3.6.1.4.1.171.10.75.14.1.1.14.1.3

searching for sysPortDescString in DES-1210-26MEbx
.iso.org.dod.internet.private.enterprises.d-link.dlink-products.dlink-DES1210SeriesProd.des-1210-26me.des-1210-26mebx.companySystem.sysPortDescriptionTable.sysPortDescriptionEntry.sysPortDescString
.1.3.6.1.4.1.171.10.75.16.1.1.14.1.3

searching for sysPortDescString in DES-1210-28-AX
.iso.org.dod.internet.private.enterprises.d-link.dlink-products.dlink-DES1210SeriesProd.des-1210-28ax.companySystem.sysPortDescriptionTable.sysPortDescriptionEntry.sysPortDescString
.1.3.6.1.4.1.171.10.75.5.1.14.1.3

searching for sysPortDescString in DES-1210-28-AXME
.iso.org.dod.internet.private.enterprises.d-link.dlink-products.dlink-DES1210SeriesProd.des-1210-28axme.companySystem.sysPortDescriptionTable.sysPortDescriptionEntry.sysPortDescString
.1.3.6.1.4.1.171.10.75.15.1.14.1.3

searching for sysPortDescString in DES-1210-28ME-B2
.iso.org.dod.internet.private.enterprises.d-link.dlink-products.dlink-DES1210SeriesProd.des-1210-28ME.des-1210-28ME-B2.companySystem.sysPortDescriptionTable.sysPortDescriptionEntry.sysPortDescString
.1.3.6.1.4.1.171.10.75.15.2.1.14.1.3

searching for sysPortDescString in DES-1210-28MEbx
.iso.org.dod.internet.private.enterprises.d-link.dlink-products.dlink-DES1210SeriesProd.des-1210-28me.des-1210-28mebx.companySystem.sysPortDescriptionTable.sysPortDescriptionEntry.sysPortDescString
.1.3.6.1.4.1.171.10.75.15.2.1.14.1.3



#!/bin/sh
# quick and dirty search all MIBS for some entry; ignore parse
# errors.
# (c) 2008, dirkx(at)apache(dot)org - under the ASLv2. MIT or any 
# BSD license.
#
STR=${1:-"sysPortDescString”}

MIBDIRS=${MIBDIRS:-`pwd`}

DIRS=`find "${MIBDIRS}/mibs" -type d | while read DIR; do /bin/echo -n :$DIR; done`

find mibs -type f | xargs grep -l "$STR" | sed -e "s|.*/||" | while read FILE
do
	echo searching for $STR in $FILE
	snmptranslate -Of -Ib -M+$DIRS -m"$FILE" "$STR" 2> /dev/null || echo not found
	snmptranslate -On -Ib -M+$DIRS -m"$FILE" "$STR" 2> /dev/null || echo not found
	echo
done



-- 
Mike Stupalov
http://observium.org