Check NTP Sync Status: chronyc tracking, ntpq, ntpstat
Check NTP Sync Status: chronyc tracking, ntpq, ntpstat
Monitor NTP time synchronization status to track time accuracy, detect time drift, and ensure reliable time synchronization. This guide shows you how to check NTP status and set up automated monitoring.
For comprehensive time synchronization monitoring, see Time Synchronization Monitoring. For monitoring system time, see Monitor System Date Timezone.
Why Checking NTP Status Matters
Accurate time synchronization is critical for log correlation, security, and application functionality. Time drift can cause authentication failures, log analysis issues, and application errors.
Method 1: Check NTP Status with ntpq
Check NTP Synchronization Status
# Check NTP status
ntpq -p
# Check NTP peer status
ntpq -pn
# Get NTP statistics
ntpstat
# Check if system is synchronized
ntpstat && echo "Synchronized" || echo "Not synchronized"
Monitor NTP Time Offset
# Check time offset
ntpq -c "rv 0 offset"
# Get detailed NTP information
ntpq -c "rv 0"
# Check time difference
ntpdate -q pool.ntp.org
Method 2: Check Chrony Status
Check Chrony Synchronization Status
# Check Chrony sources
chronyc sources
# Check Chrony tracking
chronyc tracking
# Get Chrony statistics
chronyc sourcestats
# Check if system is synchronized
chronyc tracking | grep "Leap status"
Monitor Chrony Time Accuracy
# Check time offset
chronyc tracking | grep "Last offset"
# Get system time accuracy
chronyc tracking | grep "System time"
# Check Chrony server status
chronyc activity
Method 3: Automated NTP Status Monitoring with Zuzia.app
Manual checks work while you are looking. To keep running them without you, Zuzia uses its agent and scheduled tasks.
How it works in Zuzia
- Install the Zuzia agent on the server with one command. CPU, RAM, disk, load and network metrics start reporting on their own, with alerts on a threshold, on drift from the server's normal, or on a disk fill-up forecast.
- Save the commands from this guide as a scheduled task and choose how often it runs, from every minute to once a year. The agent runs it on every host you pick.
- If a command fails, you get an alert right away by email, Slack, Discord, push (through your Pushover account) or SMS (through your Vonage account).
- The output of every run is kept, so you can look back at what changed. On paid plans, AI can read the output and alert you only when it spots a problem.
Setting it up
- Add the server in the Zuzia dashboard and install the agent.
- Create a scheduled task with the check commands below, then choose the hosts and how often it runs.
- Choose your notification channels. Turn on maintenance mode during planned work so it doesn't trigger alerts.
Best Practices for NTP Status Monitoring
1. Monitor Time Accuracy Continuously
- Track time offset regularly
- Alert when time drift exceeds thresholds
- Monitor time synchronization status
- Verify time accuracy across servers
2. Monitor NTP Service Status
- Track service running status
- Monitor service availability
- Check service logs for errors
- Alert on service failures
3. Use Multiple NTP Servers
- Configure multiple NTP servers
- Monitor NTP server reachability
- Ensure redundant time sources
- Test NTP server responses
4. Set Up Comprehensive Alerts
- Configure alerts for time drift
- Set up alerts for service failures
- Monitor synchronization status
- Alert on time accuracy issues
Troubleshooting NTP Status Issues
Step 1: Identify NTP Problems
When NTP synchronization fails:
# Check NTP status
ntpq -p
ntpstat
# Check NTP service
systemctl status ntp
# Check time offset
ntpq -c "rv 0 offset"
Step 2: Resolve NTP Issues
Based on investigation:
Fix NTP Service:
# Restart NTP service sudo systemctl restart ntp # Restart Chrony service sudo systemctl restart chronydOptimize Time Synchronization:
- Configure multiple NTP servers
- Adjust synchronization settings
- Optimize NTP server selection
Fix Time Accuracy:
- Manually sync time if needed
- Adjust system clock
- Verify NTP server accuracy
FAQ: Common Questions About NTP Status
How often should I check NTP status?
For production servers, continuous automated monitoring is essential. Zuzia.app can check NTP status every few minutes, storing historical data and alerting you when time drift exceeds thresholds.
What is considered acceptable time drift?
Acceptable time drift depends on your requirements. Generally, time drift under 100ms is excellent, 100ms-1s is acceptable, and over 1s requires attention. Set thresholds based on your application requirements.
How do I monitor NTP across multiple servers?
Zuzia.app allows you to monitor NTP status across multiple servers from one centralized dashboard. Compare time offsets across servers to ensure consistent time synchronization.
Can NTP monitoring impact server performance?
NTP monitoring commands have minimal impact on server performance. Use appropriate monitoring frequency and ensure NTP services are properly configured.
Related guides, recipes, and problems
Related guides
guides--monitoring-time-synchronization-ntp-chrony.mdguides--server-performance-monitoring-best-practices.md
Related recipes
recipes--monitor-system-date-timezone-linux.mdrecipes--monitor-system-date-time-linux.md
Related problems
problems--service-not-running-linux.md