1

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?

keye
  • 135
  • 1
  • 14

1 Answers1

0

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

Tim
  • 3,755
  • 3
  • 36
  • 57