@cryptotaxi247 / netdata-1 / commits / 53075f79d

template_foreach_fix: Fix underscore dash (#7069)

Netdata was not able to create charts when id and name were not the same this could happen when we were using templates, this commit fixes this specific problem, but it does not fix the problems that we have with dash and undescore

thiagoftsm committed Oct 14, 2019 at 14:08 UTC 53075f79dd570bef17fb64a31823dc7df212eb83
1 file changed +1 -1
database/rrddim.c
+1 -1
@@ -160,7 +160,7 @@ void rrdcalc_link_to_rrddim(RRDDIM *rd, RRDSET *st, RRDHOST *host) {
160 RRDCALC *rrdc;
161 for (rrdc = host->alarms_with_foreach; rrdc ; rrdc = rrdc->next) {
162 if (simple_pattern_matches(rrdc->spdim, rd->id) || simple_pattern_matches(rrdc->spdim, rd->name)) {
163 - if (!strcmp(rrdc->chart, st->name)) {
163 + if (rrdc->hash_chart == st->hash_name || !strcmp(rrdc->chart, st->name) || !strcmp(rrdc->chart, st->id)) {
164 char *usename = alarm_name_with_dim(rrdc->name, strlen(rrdc->name), rd->name, strlen(rd->name));
165 if (usename) {
166 if(rrdcalc_exists(host, st->name, usename, 0, 0)){