feat: add diagnostic and inspection utility scripts for infrastructure and services
This commit is contained in:
26
scripts/inspect_npm.py
Normal file
26
scripts/inspect_npm.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect("140.44.4.71", username="root", key_filename=key_path, timeout=5)
|
||||
|
||||
# Check running docker services and containers for NPM
|
||||
stdin, stdout, stderr = c.exec_command("docker ps | grep nginx")
|
||||
print("NPM CONTAINERS:")
|
||||
print(stdout.read().decode('utf-8'))
|
||||
|
||||
# Check docker volume / files
|
||||
stdin, stdout, stderr = c.exec_command("docker inspect $(docker ps -q -f name=nginx-proxy-manager_app | head -n1)")
|
||||
print("NPM INSPECT (Mounts & Env):")
|
||||
import json
|
||||
data = json.loads(stdout.read().decode('utf-8'))
|
||||
if data:
|
||||
c_info = data[0]
|
||||
print("Env:", [e for e in c_info.get('Config', {}).get('Env', []) if 'DB' in e])
|
||||
print("Mounts:", [m.get('Source') + " -> " + m.get('Destination') for m in c_info.get('Mounts', [])])
|
||||
|
||||
c.close()
|
||||
Reference in New Issue
Block a user