#!/usr/bin/env python3 import paramiko c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("10.88.0.5", username="eric", password="4669805", timeout=15) for cmd in [ "lscpu | grep 'Model name'", "grep -h speed= /home/eric/d2ypp2-src/.pm2/logs/youtube2__*-out.log 2>/dev/null | tail -6", "ps auxww | grep 'ffmpeg.*rtmps' | grep -v grep | head -1 | cut -c1-220", ]: print(">", cmd) _, o, e = c.exec_command(cmd, timeout=30, get_pty=True) print((o.read() + e.read()).decode()[:600]) c.close()