keye
keye

Reputation: 125

Parse CPU per core usage snapshot to output/text file

I am working on a python script to read CPU usage per core and do some data analysis. 'htop' can show a dynamic usage on standard output but it's not readable by the program.

Is there a way to log snapshot of 'htop' to a text file or standard output?

Upvotes: 0

Views: 384

Answers (1)

Tim
Tim

Reputation: 3803

if you have nodejs installed, you can use this package

https://github.com/sweetim/linux-top-parser

it will parse the top output into json, you can access them using the API or the CLI

Upvotes: 0

Related Questions