0

I want to get my system information(like CPU usage, available memory, free disk space, available bandwidth etc.)

Is there any open source c++(preferred) library to get this information?

I can do it using multiple system() commands in C++ but I want to use any available code that is used before.

Please let me know if any more information is required.

Thanks in advance.

Keval88
  • 36
  • 2
    There is probably a good library available, but until you find it you can already skip the system()-s by reading files in /proc, /sys, /run and /dev (use ifstream in c++). It's way faster than system() and doesn't depend on external commands. This works because everything in POSIX-compatible systems can be represented as a file. – Garo Nov 05 '19 at 13:13
  • 1
    you can read /proc/meminfo to get RAM usage, and for cpu usage, you can use that script shown in answer (don't forget that you can execute script in c++) – damadam Nov 05 '19 at 13:31

0 Answers0