ntpsec-rs-snmpd 0.3.50

NTP SNMP daemon — forensic Rust reconstruction of ntpsnmpd
ntpsec-rs-snmpd-0.3.50 is not a library.

ntpsec-rs-snmpd

crates.io Documentation License

ntpsnmpd-rs — SNMP monitoring daemon for the ntpsec-rs workspace. Polls a running NTP daemon via Mode 6 control queries and exports key performance metrics — stratum, offset, frequency, jitter, root delay, root dispersion — for ingestion by network monitoring systems.

Equivalent to NTPsec's ntpsnmpd (Python, ~48K, plus agentx.py and agentx_packet.py).

Part of the ntpsec-rs workspace — a forensic Rust reconstruction of NTPsec. v0.3.48.


Overview

Network monitoring infrastructure often relies on SNMP (Simple Network Management Protocol) to collect health metrics from managed devices. ntpsnmpd-rs bridges the NTP daemon's internal state — accessible via Mode 6 control protocol — into a format consumable by SNMP collectors such as Nagios, Zabbix, Prometheus (via SNMP exporter), and others.

The daemon runs as a persistent service, periodically querying a local or remote ntpd-rs instance and writing structured data to a file that an SNMP agent or sidecar can serve:

Metric Source Description
stratum read_system_vars() Distance from reference clock
offset read_system_vars() Clock offset from reference (seconds)
frequency read_system_vars() Clock frequency error (ppm)
sys_jitter read_system_vars() System clock jitter (seconds)
root_delay read_system_vars() Round-trip delay to root (seconds)
root_dispersion read_system_vars() Dispersion to root (seconds)

Oracle

ntpsec ntpclients/ntpsnmpd.py (Python, 48K)
ntpsec pylib/agentx.py
ntpsec pylib/agentx_packet.py

Usage

Basic usage (local daemon)

ntpsnmpd-rs

Polls ntpd-rs at 127.0.0.1:123 every 60 seconds, writing statistics to /var/log/ntpstats/snmp.

Remote NTP daemon

ntpsnmpd-rs 192.168.1.100 -p 123

Polls a remote ntpd-rs instance.

Custom SNMP port and output

ntpsnmpd-rs -s 1161 -o /var/log/ntpstats/ntp-snmp-data

Fast polling for detailed monitoring

ntpsnmpd-rs -i 5

Poll every 5 seconds for higher-resolution monitoring data.

Command-line options

Option Description Default
host NTP daemon host 127.0.0.1
-p, --port NTP daemon port 123
-s, --snmp-port SNMP agent port 1161
-i, --interval Poll interval in seconds 60
-o, --output Output file for SNMP data /var/log/ntpstats/snmp

Output format

Each poll writes a key=value file:

stratum=2
offset=0.003412
frequency=11.423
sys_jitter=0.000156
root_delay=0.021
root_dispersion=0.008

Related Crates

All crates in the ntpsec-rs workspace on crates.io:

GitHub Repository

https://github.com/infinityabundance/ntpsec-rs