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

NaN when using titleoids #1929

Closed
greasy-weasel opened this issue Mar 11, 2017 · 1 comment · Fixed by #1930
Closed

NaN when using titleoids #1929

greasy-weasel opened this issue Mar 11, 2017 · 1 comment · Fixed by #1930
Labels

Comments

@greasy-weasel
Copy link

Hi,

I found that when I used titleoids in the snmp module, I got NaN rather than port names. The cause of the problem seems to be attempting to multiple a Strings returned from netsnmp. I'm not sure the intent of the original code, however this modification fixes the issue with titleoids not working for me.

Giles

--- old-snmp.node.js 2017-03-11 09:21:07.347129394 +0000
+++ snmp.node.js 2017-03-11 11:45:01.903283373 +0000
@@ -272,7 +272,7 @@
if(__DEBUG === true)
netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + " = " + varbinds[i].value);

  •                    if(varbinds[i].type === net_snmp.ObjectType.OctetString)
    
  •                    if(varbinds[i].type === net_snmp.ObjectType.OctetString && service.snmp_oids_index[varbinds[i].oid].type !== 'title')
                           value = parseFloat(varbinds[i].value) * 1000;
                       else
                           value = varbinds[i].value;
    
ktsaou added a commit to ktsaou/netdata that referenced this issue Mar 11, 2017
@ktsaou
Copy link
Member

ktsaou commented Mar 11, 2017

Thanks for reporting this!

I was introduced with PR #1271 while attempting to fix #1236

I added the fix you suggested.

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