feat: add diagnostic and management scripts for DNS, NPM, and cluster infrastructure

This commit is contained in:
2026-11-06 19:08:19 -05:00
parent 8e1c5f1e66
commit d5c2f6eae5
19 changed files with 559 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
import paramiko
import sys
sys.stdout.reconfigure(encoding='utf-8')
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
ssh.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=5)
except Exception:
ssh.connect('140.44.4.71', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=5)
stdin, stdout, stderr = ssh.exec_command('grep -r -i "pihole" /data/nginx/proxy_host/ 2>/dev/null')
out = stdout.read().decode('utf-8', errors='ignore')
print("Grep pihole in proxy_host:\n", out)
# Also let's inspect sqlite database in NPM
stdin, stdout, stderr = ssh.exec_command('sqlite3 /data/database.sqlite "SELECT id, domain_names, forward_host, forward_port, forward_scheme, enabled FROM proxy_host WHERE domain_names LIKE \'%pihole%\' OR domain_names LIKE \'%dns%\';"')
out = stdout.read().decode('utf-8', errors='ignore')
print("\nProxy hosts in SQLite:\n", out)
ssh.close()