summaryrefslogtreecommitdiffstats
path: root/src/health
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2024-05-08 19:14:42 +0100
committerGitHub <noreply@github.com>2024-05-08 21:14:42 +0300
commit43ceb0eada3353489a7c42313aabc5370e74cf98 (patch)
tree9b6d17fe5dbe3d370b61b7ef74c155368deef850 /src/health
parent059e114cb4c16d3742768beb7cef7cd4685ed40b (diff)
log to journal all transitions (#17618)
Diffstat (limited to 'src/health')
-rw-r--r--src/health/health_log.c2
-rw-r--r--src/health/rrdcalc.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/health/health_log.c b/src/health/health_log.c
index 8839b2da5c..b04f8f248a 100644
--- a/src/health/health_log.c
+++ b/src/health/health_log.c
@@ -10,6 +10,8 @@ inline void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae) {
void health_log_alert_transition_with_trace(RRDHOST *host, ALARM_ENTRY *ae, int line, const char *file, const char *function) {
+ if(!host || !ae) return;
+
ND_LOG_STACK lgs[] = {
ND_LOG_FIELD_UUID(NDF_MESSAGE_ID, &health_alert_transition_msgid),
ND_LOG_FIELD_STR(NDF_NIDL_NODE, host->hostname),
diff --git a/src/health/rrdcalc.c b/src/health/rrdcalc.c
index e16c118991..7ee536ae20 100644
--- a/src/health/rrdcalc.c
+++ b/src/health/rrdcalc.c
@@ -241,6 +241,7 @@ static void rrdcalc_link_to_rrdset(RRDCALC *rc) {
0,
rrdcalc_isrepeating(rc)?HEALTH_ENTRY_FLAG_IS_REPEATING:0);
+ health_log_alert(host, ae);
health_alarm_log_add_entry(host, ae);
rrdset_flag_set(st, RRDSET_FLAG_HAS_RRDCALC_LINKED);
@@ -273,6 +274,7 @@ static void rrdcalc_unlink_from_rrdset(RRDCALC *rc, bool having_ll_wrlock) {
0,
0);
+ health_log_alert(host, ae);
health_alarm_log_add_entry(host, ae);
}