import paramiko

c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect('160.187.143.253', username='root', password=';ur7n)LC1BQ;')

print("Checking supreme-iam PM2 logs...")
_, so, se = c.exec_command('su - ubuntu -c "pm2 logs supreme-iam --err --lines 50 --nostream"')
print("OUT:", so.read().decode('utf-8', 'ignore'))
print("ERR:", se.read().decode('utf-8', 'ignore'))

print("Checking supreme-iam status...")
_, so, se = c.exec_command('su - ubuntu -c "pm2 status supreme-iam"')
print("OUT:", so.read().decode('utf-8', 'ignore'))
print("ERR:", se.read().decode('utf-8', 'ignore'))

c.close()
