summaryrefslogtreecommitdiffstats
path: root/database/rrdcalc.c
diff options
context:
space:
mode:
authorEmmanuel Vasilakis <mrzammler@mm.st>2021-04-20 16:24:41 +0300
committerGitHub <noreply@github.com>2021-04-20 16:24:41 +0300
commitf5bd20e60ae8a65b9c709fcd28d08c1bea268f2d (patch)
tree8897d68a69f82d8fd0732aca8c344778a5e62340 /database/rrdcalc.c
parent0a6a14e323ee3b7a2dc17b2ca5b0cce4a8b2eb5e (diff)
Provide new attributes in health conf files (#10961)
* read and store new attributes (class, component, type) from health conf files. Replace family variable in info strings * provide the attributes to jsons * remove extra semicolon * populate conf files with new attributes * added newline * remove extra defines from health.h * remove empty line * remove realloc * use helper variables for find_and_replace. Adjust position for next strstr * remove comments * Add type to mysql.conf and vcsa.conf * fix formatting * add parenthesis * remove extra assignment * changes to mysql_galera_cluster_state from master * add type Errors to unbound_request_list_overwritten * fix identation for info strings spawning more than one line * check for null, replace with empty string if true * add class, component, type to systemdunits.conf
Diffstat (limited to 'database/rrdcalc.c')
-rw-r--r--database/rrdcalc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/database/rrdcalc.c b/database/rrdcalc.c
index bc91da64f3..5455b1674c 100644
--- a/database/rrdcalc.c
+++ b/database/rrdcalc.c
@@ -91,6 +91,9 @@ static void rrdsetcalc_link(RRDSET *st, RRDCALC *rc) {
rc->name,
rc->rrdset->id,
rc->rrdset->family,
+ rc->class,
+ rc->component,
+ rc->type,
rc->exec,
rc->recipient,
now - rc->last_status_change,
@@ -165,6 +168,9 @@ inline void rrdsetcalc_unlink(RRDCALC *rc) {
rc->name,
rc->rrdset->id,
rc->rrdset->family,
+ rc->class,
+ rc->component,
+ rc->type,
rc->exec,
rc->recipient,
now - rc->last_status_change,
@@ -428,6 +434,10 @@ inline RRDCALC *rrdcalc_create_from_template(RRDHOST *host, RRDCALCTEMPLATE *rt,
if(rt->units) rc->units = strdupz(rt->units);
if(rt->info) rc->info = strdupz(rt->info);
+ if (rt->class) rc->class = strdupz(rt->class);
+ if (rt->component) rc->component = strdupz(rt->component);
+ if (rt->type) rc->type = strdupz(rt->type);
+
if(rt->calculation) {
rc->calculation = expression_parse(rt->calculation->source, NULL, NULL);
if(!rc->calculation)
@@ -535,6 +545,10 @@ inline RRDCALC *rrdcalc_create_from_rrdcalc(RRDCALC *rc, RRDHOST *host, const ch
if(rc->units) newrc->units = strdupz(rc->units);
if(rc->info) newrc->info = strdupz(rc->info);
+ if (rc->class) newrc->class = strdupz(rc->class);
+ if (rc->component) newrc->component = strdupz(rc->component);
+ if (rc->type) newrc->type = strdupz(rc->type);
+
if(rc->calculation) {
newrc->calculation = expression_parse(rc->calculation->source, NULL, NULL);
if(!newrc->calculation)
@@ -573,6 +587,9 @@ void rrdcalc_free(RRDCALC *rc) {
freez(rc->source);
freez(rc->units);
freez(rc->info);
+ freez(rc->class);
+ freez(rc->component);
+ freez(rc->type);
simple_pattern_free(rc->spdim);
freez(rc->labels);
simple_pattern_free(rc->splabels);