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

Integer value parsed incorrectly in some cases #5

Closed
burmisov opened this issue Nov 18, 2015 · 5 comments
Closed

Integer value parsed incorrectly in some cases #5

burmisov opened this issue Nov 18, 2015 · 5 comments

Comments

@burmisov
Copy link

Hi! Thanks for an awesome module!

I have a problem with a rather exotic device trying to read a temperature sensor value.
The code is simple:

var snmp = require('net-snmp');
var session = snmp.createSession('10.157.207.28', 'public', { version: snmp.Version1 });
session.get(['1.3.6.1.4.1.40418.2.4.4.1.0'], function (error, varbinds) {
    if (error) {
        throw error;
    }
    console.log('result>', varbinds);
    session.close();
});

What I get is an Integer too long (129) error. I drilled it down to the source and it looks like at this point an extra byte with value 129 is getting in the way for some reason. If I discard it prior to processing (i.e., add another buffer.readByte (); after this line, the value is parsed correctly. But I guess that'a a pretty bad hack.

I thought maybe the device is causing problems (I can read multiple other devices without issues), but both snmpget cli utility and the Free SNMP MIB Browser of ManageEngine seem to handle this OID of my device without any issues.

Maybe I will get down to the problem myself eventually, but some couple hours spent to this moment didn't bring me a solution.

@stephenwvickers
Copy link
Collaborator

Hi Sergey,

Sorry for the delay in my response.

This would suggest an issue with the structure of the response packet.

Are you able to send me a Wireshark capture which includes the SNMP response packet (or similar)?

Thanks

Steve

@burmisov
Copy link
Author

Hi Stephen!
No worries, my fork with a hack that checks for the 129 value surprisingly works for all of the devices I have at hand :)
I guess there may be wrong structure in the response, and I never would create and issue here but for snpmget getting a good result.
I'll create a capture ASAP, wen I get my hands on the device again.

@stephenwvickers
Copy link
Collaborator

That's ok, I understand.

If there is an issue there I would like to address it for you.

Thanks

Steve

@stephenwvickers
Copy link
Collaborator

If you would like to look into this further just reopen the issue and I will continue to investigate.

Thanks

Steve

@markabrahams
Copy link
Owner

markabrahams commented Nov 20, 2020

This is long closed, but @burmisov if you're still out there, and you still care, this issue is fixed in version 2.9.8 of the npm. See #136 for further details of the problem and fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants