
#Process monitor linux software#
This depends on your DB, I guess, and how you monitor it.When a piece of software starts up, the operating system serving it creates a program to run the associated program. vmstat gives you, among other things, statistics on IO caused by swap in/out (in case this is a problem in your case). netstat -s gives you network statistics so you can see how many network operations were done. There is iostat that can give you periodic summaries of how much IO was done to each disk.
#Process monitor linux code#
Any process can print the exit code of one of its sub-processes, but I'm not aware of a tool which can print the exit status of all processes in the system. Various tools I mentioned like strace/ltrace will let you know when the process they follow exits. If a process/thread terminates, why, and was it successful? If a process is depending on the results of another one. Another one you can use is valgrind.įinally, if by "memory utilization" you meant to just check how much memory your process or thread is using, well, both ps and top can tell you that. One of them called ASAN ("Address Sanitizer") is built into the C++ compiler, so you can build with it enabled and get messages on bad access patterns. If you don't want to find all memory accesses but rather are searching for bugs in this area - like accessing memory after it's freed and so on, there are tools that help you find those more easily.

The thing is that almost everything your program does will be a "memory instruction" so you'll need to know exactly what you are looking for, with breakpoints, tracepoints, single-stepping, and so on, and usually don't just want to see every memory access in your program. Memory management and utilization, what block is being accessed.Īgain ltrace will let you see all malloc()/free() calls, but to see exactly what memory is being access where, you'll need a debugger, like gdb. The strace/ltrace commands will list among other things socket creation, but if you want to know which sockets are open - connected, listening, and so on - right now, there is the netstat utility, which lists all the connected (or with "-a", also listening) sockets in the system, and which process they belong to. The ltrace tool is similar, but focuses on calls to library functions - not just system calls (which involve the kernel).

The strace command does exactly this - it lists exactly which system calls are invoked by your program.
#Process monitor linux how to#
All tools I will mention below have extensive manual pages where you can find exactly how to use them. The different things you wanted to monitor may require different tools.
