File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3997,12 +3997,17 @@ This command displays a list of NTP peers known to the server as well as a summa
39973997- Example:
39983998 ```
39993999 admin@sonic:~ $ show ntp
4000+ synchronised to NTP server (204.2.134.164) at stratum 3
4001+ time correct to within 326797 ms
4002+ polling server every 1024 s
4003+
40004004 remote refid st t when poll reach delay offset jitter
40014005 ==============================================================================
40024006 23.92.29.245 .XFAC. 16 u - 1024 0 0.000 0.000 0.000
40034007 * 204.2.134.164 46.233.231.73 2 u 916 1024 377 3.079 0.394 0.128
40044008 ```
40054009
4010+
40064011### NTP Config Commands
40074012
40084013This sub-section of commands is used to add or remove the configured NTP servers.
Original file line number Diff line number Diff line change @@ -2028,20 +2028,22 @@ def bgp(verbose):
20282028@click .option ('--verbose' , is_flag = True , help = "Enable verbose output" )
20292029def ntp (ctx , verbose ):
20302030 """Show NTP information"""
2031+ ntpstat_cmd = "ntpstat"
20312032 ntpcmd = "ntpq -p -n"
20322033 if is_mgmt_vrf_enabled (ctx ) is True :
20332034 #ManagementVRF is enabled. Call ntpq using "ip vrf exec" or cgexec based on linux version
20342035 os_info = os .uname ()
20352036 release = os_info [2 ].split ('-' )
20362037 if parse_version (release [0 ]) > parse_version ("4.9.0" ):
2037- ntpcmd = "ip vrf exec mgmt ntpq -p -n"
2038+ ntpstat_cmd = "sudo ip vrf exec mgmt ntpstat"
2039+ ntpcmd = "sudo ip vrf exec mgmt ntpq -p -n"
20382040 else :
2039- ntpcmd = "cgexec -g l3mdev:mgmt ntpq -p -n"
2041+ ntpstat_cmd = "sudo cgexec -g l3mdev:mgmt ntpstat"
2042+ ntpcmd = "sudo cgexec -g l3mdev:mgmt ntpq -p -n"
20402043
2044+ run_command (ntpstat_cmd , display_cmd = verbose )
20412045 run_command (ntpcmd , display_cmd = verbose )
20422046
2043-
2044-
20452047#
20462048# 'uptime' command ("show uptime")
20472049#
You can’t perform that action at this time.
0 commit comments