diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-08-27 02:35:05 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-08-27 02:35:05 +0300 |
commit | 73cf58f0d3bca70203c89090690a7cc9e322df25 (patch) | |
tree | 30aa0bdca9e3774c59fe56ae018f853d18d8bb74 | |
parent | 6d35680bb99d8616c198d650c27e44aa7352a572 (diff) |
switched snmp to passing 64 bit counters as strings; #2362
-rw-r--r-- | node.d/node_modules/netdata.js | 8 | ||||
-rw-r--r-- | node.d/snmp.node.js | 10 |
2 files changed, 7 insertions, 11 deletions
diff --git a/node.d/node_modules/netdata.js b/node.d/node_modules/netdata.js index 11202061e4..143255d9e1 100644 --- a/node.d/node_modules/netdata.js +++ b/node.d/node_modules/netdata.js @@ -364,12 +364,8 @@ var netdata = { if(typeof value === 'undefined' || value === null) return false; - if(this._current_chart._dimensions_count !== 0) { - if (value instanceof Buffer) - this.queue('SET ' + dimension + ' = 0x' + value.toString('hex')); - else - this.queue('SET ' + dimension + ' = ' + value.toString()); - } + if(this._current_chart._dimensions_count !== 0) + this.queue('SET ' + dimension + ' = ' + value.toString()); return true; }; diff --git a/node.d/snmp.node.js b/node.d/snmp.node.js index de867ca631..3e7027958b 100644 --- a/node.d/snmp.node.js +++ b/node.d/snmp.node.js @@ -278,17 +278,17 @@ netdata.processors.snmp = { if(service.snmp_oids_index[varbinds[i].oid].type !== 'title') // parse floating point values, exposed as strings value = parseFloat(varbinds[i].value) * 1000; - if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = '" + varbinds[i].value.toString() + "' (parsed as float in string)"); + if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = " + value.toString() + " (parsed as float in string)"); else // just use the string value = varbinds[i].value; - if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = '" + varbinds[i].value.toString() + "' (parsed as string)"); + if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = " + value.toString() + " (parsed as string)"); break; case net_snmp.ObjectType.Counter64: // copy the buffer - value = new Buffer.from(varbinds[i].value); - if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = '0x" + varbinds[i].value.toString('hex') + "' (parsed as buffer)"); + value = '0x' + varbinds[i].value.toString('hex'); + if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = " + value.toString() + " (parsed as buffer)"); break; case net_snmp.ObjectType.Integer: @@ -296,7 +296,7 @@ netdata.processors.snmp = { case net_snmp.ObjectType.Gauge: default: value = varbinds[i].value; - if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = '" + varbinds[i].value.toString() + "' (parsed as number)"); + if(__DEBUG === true) netdata.debug(service.module.name + ': ' + service.name + ': found ' + service.module.name + ' value of OIDs ' + varbinds[i].oid + ", ObjectType " + net_snmp.ObjectType[varbinds[i].type] + " (" + netdata.stringify(varbinds[i].type) + "), typeof(" + typeof(varbinds[i].value) + "), in JSON: " + netdata.stringify(varbinds[i].value) + ", value = " + value.toString() + " (parsed as number)"); break; } |