This script monitors the top CPU and memory-consuming processes on the host system and stores the data in an SQLite database. It can be run either directly on the host system or inside a Docker container.
Clone this repo and build the docker image
$ cd sonde
$ docker build -t top-processes-monitor .
- Run the Docker container:
$ docker run -d --name top-monitor -v ./database:/database -v /proc/proc top-processes-monitor
This will start the container in detached mode with the name top-monitor
.
The SQLite database file (top_processes.db
) will be stored in the specified directory (database
) and will contain two tables.
A go app that read the sqlite database app, render a web view to show you the data
- Build the Docker image:
# go back to the root
$ cd ../
$ docker build -t my-go-app .
- Run the go app
$ docker run -d -p 8080:8080 --name my-go-app-container -v ./database:/database my-go-app