fixes #369, SNMP 64 bit counters; plugins.d now accept SET = 0xHEXVALUE; node-int64 removed;
Costa Tsaousis committed
May 4, 2016 at 21:19 UTC
550f880241a177d5a1026e382d0b5a3a1ea164ff
5 files changed
+6
-17
LICENSE.md
-4
@@ -138,8 +138,4 @@ connectivity is not available.
138
Copyright 2015, Joseph Huckaby
139
[MIT License](https://github.com/jhuckaby/pixl-xml)
140
141
-- [node-int64](https://github.com/broofa/node-int64)
142
-
143
- Copyright 2014, Robert Kieffer
144
- [MIT License](https://github.com/broofa/node-int64/blob/master/LICENSE)
141
node.d/Makefile.am
-1
@@ -14,7 +14,6 @@ dist_nodemodules_DATA = \
14
node_modules/pixl-xml.js \
15
node_modules/net-snmp.js \
16
node_modules/asn1.js \
17
- node_modules/node-int64.js \
17
$(NULL)
18
19
nodemodulesberdir=$(nodedir)/node_modules/ber
node.d/node_modules/netdata.js
+2
-5
@@ -3,7 +3,6 @@
3
var url = require('url');
4
var http = require('http');
5
var util = require('util');
6
-var Int64 = require('node-int64');
6
7
/*
8
var netdata = require('netdata');
@@ -341,10 +340,8 @@ var netdata = {
340
return false;
341
342
if(this._current_chart._dimensions_count !== 0) {
344
- if (value instanceof Buffer) {
345
- var value64 = new Int64(value);
346
- this.queue('SET ' + dimension + ' = ' + value64.toString(10));
347
- }
343
+ if (value instanceof Buffer)
344
+ this.queue('SET ' + dimension + ' = 0x' + value.toString('hex'));
345
else
346
this.queue('SET ' + dimension + ' = ' + value.toString());
347
}
src/plugins_d.c
+4
-4
@@ -181,7 +181,7 @@ void *pluginsd_worker_thread(void *arg)
181
182
if(unlikely(st->debug)) debug(D_PLUGINSD, "PLUGINSD: '%s' is setting dimension %s/%s to %s", cd->fullfilename, st->id, dimension, value?value:"<nothing>");
183
184
- if(value) rrddim_set(st, dimension, atoll(value));
184
+ if(value) rrddim_set(st, dimension, strtoll(value, NULL, 0));
185
186
count++;
187
}
@@ -311,11 +311,11 @@ void *pluginsd_worker_thread(void *arg)
311
}
312
313
long multiplier = 1;
314
- if(multiplier_s && *multiplier_s) multiplier = atol(multiplier_s);
314
+ if(multiplier_s && *multiplier_s) multiplier = strtol(multiplier_s, NULL, 0);
315
if(unlikely(!multiplier)) multiplier = 1;
316
317
long divisor = 1;
318
- if(likely(divisor_s && *divisor_s)) divisor = atol(divisor_s);
318
+ if(likely(divisor_s && *divisor_s)) divisor = strtol(divisor_s, NULL, 0);
319
if(unlikely(!divisor)) divisor = 1;
320
321
if(unlikely(!algorithm || !*algorithm)) algorithm = "absolute";
@@ -351,7 +351,7 @@ void *pluginsd_worker_thread(void *arg)
351
#ifdef DETACH_PLUGINS_FROM_NETDATA
352
else if(likely(hash == MYPID_HASH && !strcmp(s, "MYPID"))) {
353
char *pid_s = words[1];
354
- pid_t pid = atol(pid_s);
354
+ pid_t pid = strtod(pid_s, NULL, 0);
355
356
if(likely(pid)) cd->pid = pid;
357
debug(D_PLUGINSD, "PLUGINSD: %s is on pid %d", cd->id, cd->pid);
web/index.html
-3
@@ -471,9 +471,6 @@
471
<i class="fa fa-circle"></i> <a href="http://D3js.org/" target="_blank">D3</a>,
472
<i class="fa fa-copyright"></i> Copyright 2015, Mike Bostock, <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">BSD License</a>
473
474
- <i class="fa fa-circle"></i> <a href="https://github.com/broofa/node-int64" target="_blank">node-int64</a>,
475
- <i class="fa fa-copyright"></i> Copyright 2014, Robert Kieffer, <a href="https://github.com/broofa/node-int64/blob/master/LICENSE" target="_blank">MIT License</a>
476
-
474
</small>
475
</div>
476
</div>