GithubHelp home page GithubHelp logo

Comments (9)

cdevr avatar cdevr commented on August 12, 2024

This error is generated when WapSNMP does not understand the data type of the object returned by the SNMP Agent (the switch/router/... you're monitoring). This is not the result of the OID starting with .1.3.

The reason almost every OID starts with 1.3 is that this is the space allocated to public, shared OIDs. Everything outside of it is vendor-specific. This usually means that these numbers are temporary, in the sense that after a software upgrade of the router or switch they may not be available anymore. Of course it also means it's where the more interesting stuff is.

from wapsnmp.

cdevr avatar cdevr commented on August 12, 2024

I am unsure what to do with this exactly since the OID you provided .1.0.8802 is a table identifier. Tables themselves do not have an object returned, the first instance should be 1.0.8802.1.1.1.1.1.1.0 .

May I ask where you're seeing this, what device/version ? Ideally I'd love a tcpdump of the data that
WapSNMP fails to parse. Alternatively I could probe the device you're having trouble with.

from wapsnmp.

Subito avatar Subito commented on August 12, 2024

OID would be .1.0.8802.1.1.2.1.5.32962.1.2.3.1.2.2.1 its from a DLINK DGS-1500.
It seems that the OID I "hacked" into MustParseOid gets automatically rewritten to something which starts with 1.3. tcpdump here: http://pastebin.com/LD3VSyXd

Of course the rewritten OID can't be found... Its invalid indeed.

from wapsnmp.

Subito avatar Subito commented on August 12, 2024

The request which produces this dump:

    oid := wapsnmp.MustParseOid(".1.0.8802.1.1.2.1.5.32962.1.2.3.1.2.45.2")
    snmp, err := wapsnmp.NewWapSNMP(d.Address, d.Community, d.Version, 2*time.Second, 5)

from wapsnmp.

cdevr avatar cdevr commented on August 12, 2024

Any chance you can send me the data dump (the file) that produces the error ? I can't seem to find the oid you mentioned here in the data you pasted.

Just tcpdump -w log.pcap, start the program to generate the error, and get log.pcap to me. ( chr -no spaces- istop -nothing here- hedevriese -at goes here- gmail.com).

from wapsnmp.

Subito avatar Subito commented on August 12, 2024

Dump should arrive shortly. I can't find the OID either - and I think this is the problem ;). The 1.0.8802 get send as 1.3.8802.

from wapsnmp.

Subito avatar Subito commented on August 12, 2024

The code which does the "rewrite" of the OID is in oid.go in DecodeOID() lines 70-72:

result := make([]int, 2)
result[0] = 1
result[1] = 3

why is this necessary?

from wapsnmp.

Subito avatar Subito commented on August 12, 2024

and again on line 99-102:

    /* Every o is supposed to start with .1.3, which is encoded as
       40 * first_byte + second byte. First_byte is ALWAYS 1, second
       byte is always 3, so it's 43, or hex 0x2b */
       result = append(result, 0x2b)

from wapsnmp.

Subito avatar Subito commented on August 12, 2024

If I change

result = append(result, 0x2b)

to

result = append(result, 0x28)

it works as expected. But it breaks all OIDs starting with 1.3 of course. I could write some edge-case patch, but that does not feel like a proper solution...

from wapsnmp.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.