Skip to content

harplife/task_manager_web

Repository files navigation

PSUTIL Web Console

개요

I want:

  1. monitor processes and threads
  2. specifically monitor a program (such as java, or python)
  3. run flask and provide real-time monitoring
  4. save log to DB to view history
  5. add in Alarm for when there's any SPIKE

Dependencies

  1. psutil = 5.8.0
  2. flask == 1.1.2

Current Functions

  1. Flask Web Server
  2. HTML with Ajax query
  3. Listing all processes
  4. Find process by name
  5. TODO: monitor CPU usuage
  6. TODO: Find "main" processes, and list its children

TODO

  1. Flask + SocketIO for streaming process STDOUT and STDERR
  2. Use threads to write STDOUT/STDERR to file
  3. Scheduler to query resource info at interval

by file explanation

apm.py

running apm.py will start a flask app that can start/stop/monitor a process.

details

  1. it runs flask app
  2. /start/number will Popen on a given file (e.g. infinite.bat), on a given number of times
  3. /running will return pids of processes that are running the file
  4. /stop will stop all procesess that are running the file
  5. /monitor will give information about all proceses running the file

NOTE

  1. Flask can't clean up after subprocess properly. atexit.register() is required. Moe tails here
  2. Flask has a weird thing where it initializes things twice. More detail here

REFS

  1. make process monitor with python (with code) link

About

Flask + Psutil

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published