How to Fix | ntpq: command not found error

How to Fix | ntpq: command not found error

Error

bash: ntpq: command not found

The ntpq utility program is used to monitor NTP daemon ntpd operations and determine performance. The program can be run either in interactive mode or controlled using command line arguments.

Note

The ntp daemon is no longer available in RHEL 8. In RHEL 8, the NTP protocol is implemented only by the chronyd daemon, provided by the chrony package. The ntp daemon is available up to RHEL 7.

Causes

Typically this error return when ntp is not available or installed  in the server. The ntpstat command will report the synchronization state of the NTP daemon running on the local machine. If the local system is found to be synchronized to a reference time source, ntpstat will report the approximate time accuracy. The “Name or service not known” error will be seen if the system cannot resolve “the server / system” for the ntpq command.

Solution

First we can check whether the ntp is enabled or installed in the server by typing below command.

[char@localhost ~]$ ntpq -p
bash: ntpq: command not found...

If above command return error. Please install ntp by using below commands.

[char@localhost ~]$ sudo yum install ntp

Restart ntp service after successful installation.

[char@localhost ~]$ systemctl restart ntpd

Check ntp service by typing below command.

[char@localhost ~]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
ad-***-****01. ***.***.***.*** 5 u 62 64 1 0.860 -14.196 0.

ntp service should be working fine.

Oh, that’s a way of the How to fix ‘ntpq: command not found error’ on my website at this time. If you have any suggestions for additional issues just leave a comment below, and I’ll see what I can do. You can find more Linux related articles from here.

Please feel free to share this post with anyone who might be interested.

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *

5 × three =

Categories