From c9a017b1d77e9edb1582dffc037831c3ff1612aa Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Thu, 1 Dec 2022 15:43:26 +0000 Subject: [PATCH] Fix Debian NTP path used by collectd plugin The collectd log was showing stacktraces on Debian when attempting to invoke the ntp plugin. ntpq is located at /usr/bin/ntpq on Debian. The plugin will now use that location when running on Debian. This will prevent the stacktraces, and fixes how collect monitors NTP. Test Plan: Build / Install / Provision AIO-SX. Enable NTP. Verify collectd logs are clean. Closes-Bug: #1998503 Signed-off-by: Al Bailey Change-Id: I23130022c92023773ace22b674845761e0ff23ec --- collectd-extensions/src/ntpq.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collectd-extensions/src/ntpq.py b/collectd-extensions/src/ntpq.py index 3808820..244ac77 100755 --- a/collectd-extensions/src/ntpq.py +++ b/collectd-extensions/src/ntpq.py @@ -78,6 +78,7 @@ PLUGIN = 'NTP query plugin' PLUGIN_INTERVAL = 300 # audit interval in secs PLUGIN_CONF = '/etc/ntp.conf' PLUGIN_EXEC = '/usr/sbin/ntpq' +PLUGIN_EXEC_DEBIAN = '/usr/bin/ntpq' PLUGIN_EXEC_OPTIONS = '-pn' PLUGIN_ALARMID = "100.114" @@ -715,7 +716,7 @@ def read_func(): data = subprocess.check_output([PLUGIN_EXEC, PLUGIN_EXEC_OPTIONS]) else: # Debian - data = subprocess.check_output([PLUGIN_EXEC, PLUGIN_EXEC_OPTIONS], encoding='utf-8') + data = subprocess.check_output([PLUGIN_EXEC_DEBIAN, PLUGIN_EXEC_OPTIONS], encoding='utf-8') # Keep this FIT test code but make it commented out for security #