diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-08-16 10:33:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 10:33:08 +0300 |
commit | 708efb41bdf952c84b60326d40c07cc69e58d19c (patch) | |
tree | 119af9c39fe3dfc6126ef1359ef95d10e86b955b /health/health_log.c | |
parent | 62ca74b0a4f5db5ae31d02cb6cbde8d322174249 (diff) |
Support chart labels in alerts (#13290)
* chart labels for alerts
* proper termination
* use strchr
* change if statement
* change label variable. add docs
* change doc
* assign buf to temp
* use new dictionary functions
* reduce variable scope
* reduce line length
* make sure rrdcalc updates labels after inserted
* reduce var scope
* add rrdcalc.c for cmocka tests
* Revert "add rrdcalc.c for cmocka tests"
This reverts commit 5fe122adcf7abcbe6d67fa2ebd7c4ff8620cf9c8.
* Fix cmocka unit tests
* valgrind errors
Co-authored-by: Vladimir Kobal <vlad@prokk.net>
Diffstat (limited to 'health/health_log.c')
-rw-r--r-- | health/health_log.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/health/health_log.c b/health/health_log.c index f0a05531d3..d880625e05 100644 --- a/health/health_log.c +++ b/health/health_log.c @@ -512,23 +512,8 @@ inline ALARM_ENTRY* health_create_alarm_entry( ae->old_value_string = strdupz(format_value_and_unit(value_string, 100, ae->old_value, ae->units, -1)); ae->new_value_string = strdupz(format_value_and_unit(value_string, 100, ae->new_value, ae->units, -1)); - char *replaced_info = NULL; - if (likely(info)) { - char *m; - replaced_info = strdupz(info); - size_t pos = 0; - while ((m = strstr(replaced_info + pos, "$family"))) { - char *buf = NULL; - pos = m - replaced_info; - buf = find_and_replace(replaced_info, "$family", (ae->family) ? ae->family : "", m); - freez(replaced_info); - replaced_info = strdupz(buf); - freez(buf); - } - } - - if(replaced_info) ae->info = strdupz(replaced_info); - freez(replaced_info); + if (info) + ae->info = strdupz(info); ae->old_status = old_status; ae->new_status = new_status; |