feat: add cluster auditing, management, and upgrade scripts
This commit is contained in:
18
scripts/inspect_npm_hosts.py
Normal file
18
scripts/inspect_npm_hosts.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import paramiko
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
py_script = """sudo python3 -c '
|
||||
import sqlite3
|
||||
conn = sqlite3.connect("/var/lib/docker/volumes/nginx-proxy-manager_nginx-data/_data/database.sqlite")
|
||||
cur = conn.cursor()
|
||||
for row in cur.execute("select id,domain_names,forward_host,forward_port,enabled from proxy_host"):
|
||||
print(row)
|
||||
'"""
|
||||
_, out, err = ssh.exec_command(py_script)
|
||||
print(out.read().decode())
|
||||
print("ERR:", err.read().decode())
|
||||
|
||||
ssh.close()
|
||||
Reference in New Issue
Block a user