zioinfo-mail/scripts/check/get_mail_error.py
2026-06-01 21:55:48 +09:00

8 lines
435 B
Python

import paramiko, sys
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=10)
_, o, _ = c.exec_command('cat /var/log/zioinfo/mail.log 2>/dev/null | grep -A 30 "500\\|Error\\|Exception\\|Traceback" | tail -50', timeout=10)
print(o.read().decode('utf-8','replace'))
c.close()