import paramiko
import json

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

_, so, _ = c.exec_command('pm2 jlist')
data = json.loads(so.read().decode('utf-8', 'ignore').strip())
for proc in data:
    if proc['name'] == 'supreme-iam':
        print("supreme-iam CWD:", proc['pm2_env']['pm_cwd'])
        print("supreme-iam SCRIPT:", proc['pm2_env']['pm_exec_path'])
        print("supreme-iam ARGS:", proc['pm2_env']['args'])

c.close()
