feat(pillar-4): complete dual-npm keepalived HA cluster on VIP 140.44.4.70
This commit is contained in:
25
scripts/inspect_container_nginx.py
Normal file
25
scripts/inspect_container_nginx.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import paramiko
|
||||
|
||||
def main():
|
||||
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)
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('sudo docker ps --filter "name=nginx-proxy-manager_app" -q')
|
||||
cid = stdout.read().decode().strip()
|
||||
print("Container ID:", cid)
|
||||
|
||||
if cid:
|
||||
stdin, stdout, stderr = ssh.exec_command(f'sudo docker exec {cid} nginx -t')
|
||||
print("NGINX -t STDOUT:\n", stdout.read().decode())
|
||||
print("NGINX -t STDERR:\n", stderr.read().decode())
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command(f'sudo docker exec {cid} curl -I http://127.0.0.1:80')
|
||||
print("CURL 80 INSIDE:\n", stdout.read().decode())
|
||||
print("CURL 80 STDERR:\n", stderr.read().decode())
|
||||
|
||||
ssh.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user