Skip to content

alexandre-k/procps

Repository files navigation

procps

About

procps is a package to manage processes. Currently in its early stages of development, the purpose is to enable people to use this library like psutil in Python.

It should be convenient, easy to use.

Command line interface

Several actions are available via the command line:

  • Process Management visualization tool. To visually manage processes, you can use start the web interface:
procps start-server

It will start a web server to show currently monitored processes. Processes are monitored through the API or the CLI. Just do ctrl-c to stop it.

Through the CLI, you can also show a process you created:

procps show "process id"

Or list all processes currently being monitored:

procps list-all
  • Monitored processes creation
procps create "process id" "process command"

To create a monitored process through the API or the CLI.

  • Search utilities to find currently working processes.
procps find "process name"

Web Interface

You can handle processes if you want with a web interface. You will get a quick summary from there. You'll be able also to start, restart or stop processes at will.

API

Summary

Being currently in its early stages of development, the API is subject to changes. It supports Linux only currently. I may add a support for BSD OSes, but I will likely support Windows in the future but with tests only conducted in a virtual machine.

Usage examples

How you can get a process and some basic information about it:

Prelude> import Process.Manage as PM
Prelude P> PM.findProcess PM.PName "thunderbird"
[Process {pname = "thunderbird", pid = "3654", command = "/usr/lib/thunderbird/thunderbird\NUL"}]

See information about the current directory of a process and the environment variables used for it:

Prelude> import Process.Information as PI
Prelude PI> PI.seeCwd "1873"
"/home/alex"

TODO

  • Log everything from processes
  • Complete the integration of functions with the command line interface
  • See the logs from the web interface
  • Start, restart and stop from web interface
  • Improve documentation
  • Add tests
  • Ease the use of function by accepting not only string but the Process data type
  • Refactor System functions related to processes and function to manage processes in different modules
  • Add skeleton for BSD support and abstract directory names access.
  • Improve abstraction of platform dependent functions