log to journal all transitions (#17618)
Costa Tsaousis committed
May 8, 2024 at 19:14 UTC
43ceb0eada3353489a7c42313aabc5370e74cf98
2 files changed
+4
src/health/health_log.c
+2
@@ -10,6 +10,8 @@ inline void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae) {
10
11
12
void health_log_alert_transition_with_trace(RRDHOST *host, ALARM_ENTRY *ae, int line, const char *file, const char *function) {
13
+ if(!host || !ae) return;
14
+
15
ND_LOG_STACK lgs[] = {
16
ND_LOG_FIELD_UUID(NDF_MESSAGE_ID, &health_alert_transition_msgid),
17
ND_LOG_FIELD_STR(NDF_NIDL_NODE, host->hostname),
src/health/rrdcalc.c
+2
@@ -241,6 +241,7 @@ static void rrdcalc_link_to_rrdset(RRDCALC *rc) {
241
0,
242
rrdcalc_isrepeating(rc)?HEALTH_ENTRY_FLAG_IS_REPEATING:0);
243
244
+ health_log_alert(host, ae);
245
health_alarm_log_add_entry(host, ae);
246
rrdset_flag_set(st, RRDSET_FLAG_HAS_RRDCALC_LINKED);
247
@@ -273,6 +274,7 @@ static void rrdcalc_unlink_from_rrdset(RRDCALC *rc, bool having_ll_wrlock) {
274
0,
275
0);
276
277
+ health_log_alert(host, ae);
278
health_alarm_log_add_entry(host, ae);
279
}
280