Third Eye Blind : System monitoring + Program Control

When working on some projects, there are occassions where I suspect a bottleneck in hardware resources, but have no quick and dirty way to verify it with log and timestamp.

With that in mind I programmed a simple python script that monitors system metrics, CPU, RAM, GPU, and disk usage. The metrics are then written into a log file.

This little script can also be used to launch and terminate program.

And all these features can be called via web api. Here are some screenshots of the script in action:

The name of the program is an homage to a 90’s rock band. Config folder contains configuration of program shortcut to launch / terminate. Logs folder contains the log file for system metrics.

The name of the program is an homage to a 90’s rock band. Config folder contains configuration of program shortcut to launch / terminate. Logs folder contains the log file for system metrics.

The config file which describes the name and location of the program.

The config file which describes the name and location of the program.

The main interface of the program.

The main interface of the program.

Web API call to view current system metric.

Web API call to view current system metric.

The API call to view system metrics history (up to 12 samples), with the rest of the history can be viewed in log file.

The API call to view system metrics history (up to 12 samples), with the rest of the history can be viewed in log file.

API call to launch the specified program.

API call to launch the specified program.

The program will not double launch the program if it’s already running.

The program will not double launch the program if it’s already running.

API call to terminate the program.

API call to terminate the program.

The log file format.

The log file format.

And to improve this script in the future, I will probably add these features:

  • Grafana integration

  • Add authentication to the web api

  • Monitor program health and status

Anyway, the github repo is here: https://github.com/lawrenceloh1/ThirdEyeBlind

Previous
Previous

Pixel Collector: Collecting Pixels and Payments

Next
Next

Disguise Monitoring // Stage Precision // Google Sheets