I would like to know if someone can point me any library or tutorial to work with measurements. In a first moment, CPU usage, but latter I will need network (I’ve already found libcap, is this good?) and memory usages also.
I believe that each of then will be a different library or project, so thanks in advance.
I am currently working in a database monitoring system for UNIX system, in C++.
PS.: is there a way to access the htop programmatically from c++?
Pedro
Look into the
/procfilesystem. It contains a bunch of plain-text files with system statistics./proc/stathas cpu info, and/proc/net/*has network info.Additionally,
/proc/<pid>/*contains information about a specific process.