xjf6b commited on
Commit
622dc75
·
verified ·
1 Parent(s): df42382

Update vps_monitor.py

Browse files
Files changed (1) hide show
  1. vps_monitor.py +4 -4
vps_monitor.py CHANGED
@@ -89,11 +89,11 @@ def check_and_run_script(config):
89
  if output and (last_pid or script_path in output):
90
  parts = output.split()
91
  if last_pid:
92
- pid = parts[0]
93
- runtime = parts[1]
94
  else:
95
- pid = parts[1]
96
- runtime = parts[9] if len(parts) > 9 else "00:00"
97
  status = "Running"
98
  logger.info(f"Script {script_name} is running. PID: {pid}, Runtime: {runtime}")
99
  else:
 
89
  if output and (last_pid or script_path in output):
90
  parts = output.split()
91
  if last_pid:
92
+ pid = last_pid
93
+ runtime = parts[1] if len(parts) > 1 else "Unknown"
94
  else:
95
+ pid = parts[1] if len(parts) > 1 else "Unknown"
96
+ runtime = parts[9] if len(parts) > 9 else "Unknown"
97
  status = "Running"
98
  logger.info(f"Script {script_name} is running. PID: {pid}, Runtime: {runtime}")
99
  else: