Hi all, I'm new to Linux but have some experience with C++ and I'm stuck on this problem.
I'm trying to write a simple C++ program that will monitor the system page in and page outs in real time and alert the user if/when a process reaches a set threshold. How can I get the values from page in and page out columns (in vmstat output) for each process and for each row compare the values to the threshold (set by the user)? I feel like this should be as simple as running a for loop where I get the value of the page out column from a system command for each process and compare it, then move on to the next process. But, how would I isolate the value in page out column so I can just compare that value? Also, how would I make sure each iteration of the loop only reads one process from the vmstat output?
Thank you
Bookmarks