Skip to content

Instantly share code, notes, and snippets.

View jeffsf's full-sized avatar
🦜

Jeff Kletsky jeffsf

🦜
  • Near San Francisco
View GitHub Profile
@jeffsf
jeffsf / chrony_ntp_logconv.py
Created March 16, 2023 00:51 — forked from TheBlueMatt/chrony_ntp_logconv.py
Convert Chrony logs to ntp log format for ntpsec ntpviz graphing
#!/usr/bin/env python3
# Convert chrony's tracking and statistics logs to something ntpsec's ntpviz can graph
# Assumes chrony's logs are in /var/log/chrony and outputs to /var/log/ntpstats
# See below and fill in an adapter from your local refid names for refclocks to NTPd style
# IPs for refclocks.
import shutil, os, math
from datetime import datetime, timezone