import paramiko
import sys

try:
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect('secabarindamsiliwangi.id', port=2223, username='secb8641', password='cMdm2EsjNjMQ14', timeout=5)
    
    stdin, stdout, stderr = ssh.exec_command('cat /home/secb8641/public_html/vyata-canteen.secabarindamsiliwangi.id/telegram_thread_error.log')
    print("ERR_LOG:", stdout.read().decode())
    
    stdin, stdout, stderr = ssh.exec_command('cat /home/secb8641/public_html/vyata-canteen.secabarindamsiliwangi.id/stderr.log | tail -n 20')
    print("STDERR_LOG:", stdout.read().decode())
    ssh.close()
except Exception as e:
    print(f"Error: {e}")
