32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
import paramiko
|
|
import sys
|
|
|
|
if sys.platform == 'win32':
|
|
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
|
|
sys.stderr.reconfigure(encoding='utf-8', errors='replace')
|
|
|
|
HOST = "161.97.93.156"
|
|
USER = "carlos"
|
|
PASSWORD = "Innova1978+*?"
|
|
|
|
try:
|
|
ssh = paramiko.SSHClient()
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect(HOST, username=USER, password=PASSWORD, timeout=10)
|
|
|
|
stdin, stdout, stderr = ssh.exec_command('docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"')
|
|
print("=== DOCKER PS ===")
|
|
print(stdout.read().decode('utf-8'))
|
|
|
|
stdin, stdout, stderr = ssh.exec_command('docker logs --tail 30 dripzone-production 2>&1')
|
|
print("=== DRIPZONE PRODUCTION LOGS ===")
|
|
print(stdout.read().decode('utf-8'))
|
|
|
|
stdin, stdout, stderr = ssh.exec_command('ps aux | grep -E "docker|build" | grep -v grep')
|
|
print("=== RUNNING BUILDS / PROCESSES ===")
|
|
print(stdout.read().decode('utf-8'))
|
|
|
|
ssh.close()
|
|
except Exception as e:
|
|
print("Error:", e)
|