feat: add diagnostic and traffic policy management scripts for DNS and Pi-hole
This commit is contained in:
12
scripts/check_current_clients.py
Normal file
12
scripts/check_current_clients.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import paramiko
|
||||
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
client.connect("140.44.4.11", username="root", key_filename=r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet", timeout=10)
|
||||
|
||||
cmd = 'k3s kubectl exec -n dns deploy/pihole -c pihole -- tail -n 25 /var/log/pihole/pihole.log'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
print("Queries by client on Aerodrome in last 15 min:")
|
||||
print(stdout.read().decode())
|
||||
print("Stderr:", stderr.read().decode())
|
||||
client.close()
|
||||
Reference in New Issue
Block a user