disable plugins and disconnect slaves that send dimensions that are not known by netdata; #2117
Costa Tsaousis (ktsaou) committed
Apr 25, 2017 at 01:01 UTC
c1477fd14a8f0dfbad688d733eef003ec7a3c521
1 file changed
+10
-1
src/plugins_d.c
+10
-1
@@ -159,7 +159,16 @@ inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, FILE *fp, int
159
160
if(unlikely(rrdset_flag_check(st, RRDSET_FLAG_DEBUG))) debug(D_PLUGINSD, "PLUGINSD: '%s' is setting dimension %s/%s to %s", cd->fullfilename, st->id, dimension, value?value:"<nothing>");
161
162
- if(value) rrddim_set(st, dimension, strtoll(value, NULL, 0));
162
+ if(value) {
163
+ RRDDIM *rd = rrddim_find(st, dimension);
164
+ if(unlikely(!rd)) {
165
+ error("PLUGINSD: '%s' is requesting a SET to dimension with id '%s' on stats '%s' (%s) on host '%s', which does not exist. Disabling it.", cd->fullfilename, dimension, st->name, st->id, st->rrdhost->hostname);
166
+ enabled = 0;
167
+ break;
168
+ }
169
+ else
170
+ rrddim_set_by_pointer(st, rd, strtoll(value, NULL, 0));
171
+ }
172
}
173
else if(likely(hash == BEGIN_HASH && !strcmp(s, "BEGIN"))) {
174
char *id = words[1];