Files
SnarfCode/scripts/check_technitium_config.py

17 lines
790 B
Python

import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('140.44.4.11', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
stdin, stdout, stderr = ssh.exec_command('k3s kubectl exec -n dns deployment/technitium-dns -- cat /etc/dns/log.config')
print("log.config:")
print(stdout.read().decode('utf-8', errors='ignore'))
# Check where logs are saved or what log.config says
stdin, stdout, stderr = ssh.exec_command('k3s kubectl exec -n dns deployment/technitium-dns -- python3 -c "import json; print(open(\"/etc/dns/auth.config\", \"rb\").read())" 2>/dev/null || od -c /etc/dns/auth.config | head -n 30')
print("auth.config raw:")
print(stdout.read().decode('utf-8', errors='ignore'))
ssh.close()