Development

This commit is contained in:
Matthew Grotke 2026-06-09 15:49:07 -04:00
parent 836f4557f2
commit 46afed7965
2 changed files with 19 additions and 7 deletions

View file

@ -34,6 +34,8 @@ import sys
import logging
from pathlib import Path
import mod_metrics as metrics
SCRIPT_DIR = Path(__file__).parent
CONFIG_FILE = SCRIPT_DIR / "config.json"
CACHE_SERVICE_FILE = SCRIPT_DIR / ".ddns-last-service"
@ -650,5 +652,14 @@ def main():
rotate_radius_log(cfg.get("_radius", {}))
refresh_arp_cache(cfg)
try:
with open(CONFIG_FILE) as f:
full_cfg = json.load(f)
new_metrics = metrics.collect_metrics(full_cfg)
if new_metrics:
metrics.update_metrics_file(new_metrics)
except Exception as e:
log.warning(f"DNS metrics collection failed: {e}")
if __name__ == "__main__":
main()