parent
c85e4e5149
commit
4e827f2513
@ -0,0 +1,24 @@
|
||||
import subprocess
|
||||
import logging
|
||||
from flask import jsonify
|
||||
|
||||
def execute_cpu_full_script():
|
||||
script_path = '/data/ww/py_sys_monitor/control/cpu_full.py'
|
||||
try:
|
||||
result = subprocess.run(['python3', script_path], capture_output=True, text=True, check=True)
|
||||
output = result.stdout
|
||||
return jsonify({"message": "successfully", "output": output})
|
||||
except subprocess.CalledProcessError as e:
|
||||
logging.info("")
|
||||
return jsonify({"message": "failed", "error": str(e.output)})
|
||||
|
||||
|
||||
def execute_memory_full_script():
|
||||
script_path = '/data/ww/py_sys_monitor/control/memory_full.py'
|
||||
try:
|
||||
result = subprocess.run(['python3', script_path], capture_output=True, text=True, check=True)
|
||||
output = result.stdout
|
||||
return jsonify({"message": "successfully", "output": output})
|
||||
except subprocess.CalledProcessError as e:
|
||||
logging.info("")
|
||||
return jsonify({"message": "failed", "error": str(e.output)})
|
Loading…
Reference in new issue