Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated "show ntp" to use cgexec when management vrf is enabled #627

Merged
merged 4 commits into from
Sep 9, 2019
Merged

updated "show ntp" to use cgexec when management vrf is enabled #627

merged 4 commits into from
Sep 9, 2019

Conversation

kannankvs
Copy link
Collaborator

When management VRF is enabled, the linux command/exe "ntpq" should be called using "cgexec -g l3mdev:mgmt".
"show ntp" is updated for the same.
Result of "show ntp" after enabling management VRF using "config vrf add mgmt" is as follows.
root@sonic:~# show ntp
remote refid st t when poll reach delay offset jitter

23.92.29.245 .STEP. 16 u - 256 0 0.000 0.000 0.000
*204.2.134.164 44.24.199.34 3 u 31 64 377 201.063 0.444 0.514
root@sonic:~#

show/main.py Outdated Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
@jleveque jleveque merged commit c94dce7 into sonic-net:master Sep 9, 2019
if 'mgmtVrfEnabled' in mvrf_dict['vrf_global']:
if (mvrf_dict['vrf_global']['mgmtVrfEnabled'] == "true"):
#ManagementVRF is enabled. Call ntpq using cgexec
ntpcmd = "cgexec -g l3mdev:mgmt ntpq -p -n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command should be run with sudo privilege by either prepending the ntpcmd string or running show ntp with sudo

$ show ntp
cgroup change of group failed
$ sudo show ntp                               
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants