From 03a097164616acd1945d9d1feaca78971e432da4 Mon Sep 17 00:00:00 2001 From: Peter Morgan Date: Sun, 2 Jan 2022 16:49:01 -0500 Subject: [PATCH 1/2] Fix for issue introduced in PR698 --- src/diamond/utils/scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diamond/utils/scheduler.py b/src/diamond/utils/scheduler.py index 7e14d53fc..e46d76370 100644 --- a/src/diamond/utils/scheduler.py +++ b/src/diamond/utils/scheduler.py @@ -52,7 +52,7 @@ def collector_process(collector, metric_queue, log): # avoid having all collectors running at the same time next_window = math.floor(time.time() / interval) * interval - if str_to_bool(self.config['stagger_collection']): + if str_to_bool(collector.config['stagger_collection']): stagger_offset = random.uniform(0, interval - 1) # Allocate time till the end of the window for the collector to run. With a From 0559cb212559a852fce9a3cdb8643c1d129f41d4 Mon Sep 17 00:00:00 2001 From: Peter Morgan Date: Sun, 2 Jan 2022 17:06:49 -0500 Subject: [PATCH 2/2] Fix incorrect ntpq 'offset' field number --- src/collectors/ntpd/ntpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collectors/ntpd/ntpd.py b/src/collectors/ntpd/ntpd.py index 06f5a13ac..bed84ffcf 100644 --- a/src/collectors/ntpd/ntpd.py +++ b/src/collectors/ntpd/ntpd.py @@ -76,7 +76,7 @@ def get_ntpq_stats(self): data['poll'] = {'val': parts[5], 'precision': 0} data['reach'] = {'val': parts[6], 'precision': 0} data['delay'] = {'val': parts[7], 'precision': 6} - data['offset'] = {'val': parts[7], 'precision': 0} + data['offset'] = {'val': parts[8], 'precision': 0} data['jitter'] = {'val': parts[9], 'precision': 6} def convert_to_second(when_ntpd_ouput):