From e2f0643d7b2a5b7f2f4774965c897b50b2427715 Mon Sep 17 00:00:00 2001 From: Ginko <152240782+Giggum@users.noreply.github.com> Date: Sun, 14 Apr 2024 03:15:52 -0400 Subject: ntp: T4909: Rewrite NTP op mode in new format ntp: T4909: Rewrite NTP op mode in new format Adapts ntp.xml.in to reference new ntp.py file Add ntp.py Adds a check to ntp.py to verify if the ntp service is configured Adds raw mode to ntp.py For raw output, replaces the original method of parsing the command line output FROM re.split+regex TO csv.reader. Separates chrony commands into equivalent functions show_tracking, show_sources, source_sourcestats and show_activity Revises the names of raw dictionary keys variables to be lowercase Corrects a comment typo and renames function name used for raw mode (cherry picked from commit d2a82c30695c2f4265dc5ca2165d27d5aa3e2cef) --- op-mode-definitions/ntp.xml.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/ntp.xml.in b/op-mode-definitions/ntp.xml.in index b8d0c43ec..17250a45e 100644 --- a/op-mode-definitions/ntp.xml.in +++ b/op-mode-definitions/ntp.xml.in @@ -6,13 +6,25 @@ Show peer status of NTP daemon - ${vyos_op_scripts_dir}/show_ntp.sh --sourcestats + ${vyos_op_scripts_dir}/ntp.py show_sourcestats + + + Report the number of servers and peers that are online and offline + + ${vyos_op_scripts_dir}/ntp.py show_activity + + + + Show information about the current time sources being accessed + + ${vyos_op_scripts_dir}/ntp.py show_sources + Show parameters about the system clock performance - ${vyos_op_scripts_dir}/show_ntp.sh --tracking + ${vyos_op_scripts_dir}/ntp.py show_tracking -- cgit v1.2.3