Skip to content
Advertisement

Programmatically monitor process state using C++

I have to develop an application in C++ to monitor the state of processes in my Linux system and also need to know if a new process is created or an existing process is terminated. Is there an API available for this? Also it will be helpful if someone could tell me how to start it with.

Advertisement

Answer

inotify works well for all directories I tried, except the proc filesystem. So again I continued to search for a solution and where I reached was the proc connector and socket filters. Not much documented, but really worthy. Just have a look at:

http://netsplit.com/the-proc-connector-and-socket-filters

The way to reach this conclusion was through the answer provided by David Crookes to Detect launching of programs on Linux platform.

Hope it will help someone in future.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement