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?
if you have nodejs installed, you can use this package
https://github.com/sweetim/linux-top-parser
it will parse the
topoutput intojson, you can access them using the API or the CLI