diff options
-rw-r--r-- | collectors/timex.plugin/plugin_timex.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/collectors/timex.plugin/plugin_timex.c b/collectors/timex.plugin/plugin_timex.c index b8d75e5733..34a3415a0b 100644 --- a/collectors/timex.plugin/plugin_timex.c +++ b/collectors/timex.plugin/plugin_timex.c @@ -67,8 +67,17 @@ void *timex_main(void *ptr) struct timex timex_buf = {}; int sync_state = 0; + static int prev_sync_state = 0; sync_state = ADJUST_TIMEX(&timex_buf); + + int non_seq_failure = (sync_state == -1 && prev_sync_state != -1); + prev_sync_state = sync_state; + + if (non_seq_failure) { + error("Cannot get clock synchronization state"); + continue; + } collected_number divisor = USEC_PER_MS; if (timex_buf.status & STA_NANO) |