17 lines
621 B
Python
17 lines
621 B
Python
import paramiko
|
|
import sys
|
|
import io
|
|
|
|
if sys.platform == 'win32':
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
|
|
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace')
|
|
|
|
client = paramiko.SSHClient()
|
|
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
client.connect('161.97.93.156', username='carlos', password='Innova1978+*?', timeout=20)
|
|
|
|
stdin, stdout, stderr = client.exec_command('docker logs --tail 100 api-i5mzip2g7cmyvc56n9ewahbb')
|
|
print("Evolution API logs:\n", stdout.read().decode('utf-8', errors='replace'))
|
|
|
|
client.close()
|