@cryptotaxi247 / netdata-1 / commits / a129b10e5

Show error when clock synchronization state is unavailable (#12667)

* Show error when clock synchronization state is unavailable * Update collectors/timex.plugin/plugin_timex.c Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud> * Update collectors/timex.plugin/plugin_timex.c Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>

Vladimir Kobal committed Apr 12, 2022 at 13:40 UTC a129b10e58fb40e1c4a6e32942954cff7fca1b84
1 file changed +9
collectors/timex.plugin/plugin_timex.c
+9
@@ -67,8 +67,17 @@ void *timex_main(void *ptr)
67
68 struct timex timex_buf = {};
69 int sync_state = 0;
70 + static int prev_sync_state = 0;
71
72 sync_state = ADJUST_TIMEX(&timex_buf);
73 +
74 + int non_seq_failure = (sync_state == -1 && prev_sync_state != -1);
75 + prev_sync_state = sync_state;
76 +
77 + if (non_seq_failure) {
78 + error("Cannot get clock synchronization state");
79 + continue;
80 + }
81
82 collected_number divisor = USEC_PER_MS;
83 if (timex_buf.status & STA_NANO)