Skip to content

Add NTP Probe support for time synchronization monitoring #38

@servak

Description

@servak

Summary

Add NTP probe functionality to enable time synchronization monitoring for network engineers. This feature will help monitor NTP server availability, response times, and time accuracy.

Motivation

NTP monitoring is important for network engineers to:

  • Monitor NTP server availability and response times
  • Validate time synchronization accuracy
  • Detect NTP server failures and timeouts
  • Monitor time drift between local and remote servers
  • Ensure network infrastructure time consistency

Proposed Implementation

Target Format

mping ntp://pool.ntp.org             # Public NTP server
mping ntp://time.google.com          # Google NTP server
mping ntp://192.168.1.1              # Local NTP server

Features

  • NTP query response time measurement
  • Time offset calculation between local and remote time
  • NTP server reachability testing
  • Configurable NTP version support
  • Integration with existing TUI display
  • Time accuracy reporting

Technical Requirements

  • Implement NTPProber following existing Prober interface
  • Add NTPConfig for NTP-specific configuration
  • Use NTP protocol implementation (standard UDP port 123)
  • Calculate time offset and round-trip delay
  • Integrate with existing event system and metrics collection
  • Add configuration options in YAML config file

Configuration Example

prober:
  ntp:
    probe: ntp
    ntp:
      version: 4             # NTP version (default: 4)
      port: 123              # NTP port (default: 123)
      max_offset: 1000ms     # Maximum acceptable time offset

Acceptance Criteria

  • NTP queries can be performed against specified servers
  • Query response time is measured and reported
  • Time offset is calculated and displayed
  • Timeout and connection failures are properly handled
  • NTP version compatibility is maintained
  • Integration with existing TUI works correctly
  • Configuration is properly loaded from YAML
  • Unit tests are implemented
  • Documentation is updated

Implementation Notes

  • Follow existing probe architecture and patterns
  • Handle NTP response modes properly
  • Consider showing time offset in addition to RTT
  • Ensure accurate time calculation handling
  • Support standard NTP packet format

Priority

Medium - Useful for network infrastructure monitoring, especially in environments requiring time synchronization.

Technical Considerations

  • NTP uses UDP protocol on port 123
  • Need to implement basic NTP packet structure
  • Consider leap second and stratum information
  • Time calculations should handle timezone considerations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions