Forum Discussion
fanta_377379
Apr 22, 2019Nimbostratus
NTP peer server configuration with F5
I have an issue to verify NTP peer server configuration with F5.
In BIG_IP command line, the command is : ntpq -np and check the output.
But, I have to replicate this in F5-SDK to automate the check...
youssef1
Apr 23, 2019Cumulonimbus
Hi,
You have 2 way to achieve your need:
You can use ntpq for that.
First, calculate the offset and store it in a var:
ntp_offset=$(ntpq -pn | /usr/bin/awk 'BEGIN { offset=1000 } $1 ~ /\*/ { offset=$9 } END { print offset }')
- Server OK when: ntp_offset < 1000
- Server unsynchronised when: ntp_offset >= 1000
The second way is to use ntpstat:
-
Output when ntp is synched: synchronised to NTP server (10.1.11.33) at stratum 2 time correct to within 107 ms polling server every 1024 s
-
Output when ntp is unsynchronised:
unsynchronised
For more info: https://www.cyberciti.biz/faq/linux-unix-bsd-is-ntp-client-working/
Regards
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects