Calculate name hash after rrdvar_fix_name (#13509)
do the hash after rrdvar_fix_name
Emmanuel Vasilakis committed
Aug 11, 2022 at 16:50 UTC
5b6a8ccbfbf6131b6baf915124278595a1a6e5e6
1 file changed
+2
-2
health/health_config.c
+2
-2
@@ -686,7 +686,6 @@ static int health_readfile(const char *filename, void *data) {
686
rc = callocz(1, sizeof(RRDCALC));
687
rc->next_event_id = 1;
688
rc->name = strdupz(value);
689
- rc->hash = simple_hash(rc->name);
689
rc->source = health_source_file(line, filename);
690
rc->green = NAN;
691
rc->red = NAN;
@@ -703,6 +702,7 @@ static int health_readfile(const char *filename, void *data) {
702
if(rrdvar_fix_name(rc->name))
703
error("Health configuration renamed alarm '%s' to '%s'", value, rc->name);
704
705
+ rc->hash = simple_hash(rc->name);
706
alert_cfg->alarm = strdupz(rc->name);
707
ignore_this = 0;
708
}
@@ -724,7 +724,6 @@ static int health_readfile(const char *filename, void *data) {
724
725
rt = callocz(1, sizeof(RRDCALCTEMPLATE));
726
rt->name = strdupz(value);
727
- rt->hash_name = simple_hash(rt->name);
727
rt->source = health_source_file(line, filename);
728
rt->green = NAN;
729
rt->red = NAN;
@@ -738,6 +737,7 @@ static int health_readfile(const char *filename, void *data) {
737
if(rrdvar_fix_name(rt->name))
738
error("Health configuration renamed template '%s' to '%s'", value, rt->name);
739
740
+ rt->hash_name = simple_hash(rt->name);
741
alert_cfg->template_key = strdupz(rt->name);
742
ignore_this = 0;
743
}