ProcAn: An adaptive Process Analysis Tool for FreeBSD, OpenBSD, and Linux
What is ProcAn?
ProcAn is a process analysis tool that works by querying the list of running processes
looking for 'interesting' processes. An interesting process is one that is allocating memory or spending
any significant amount of time on the run queue. On a desktop system this means that you can track what programs
you are using the most and on server systems it provides you with a good view of what processes are interesting,
seperating these from mostly idle ones. It does all of this, not by looking at how much total resources are consumed
by an application but by looking at HOW those resources are used. Combine this analysis system with a handfull of
pretty useful backends and you have a powerful tool that can make life as an administrator slightly easier.
You can find out more information by reading this first article (link after this section), which is a little out of
date as far as the systems that are support but is still very thorough, and the README
How do I build it?
Procan uses GNU Make and will automatically determine which operating system you are using
so all you need to do is type: make (on linux) and: gmake (on FreeBSD and OpenBSD after installing GNU Make)
The FreeBSD version uses libkvm which is present on all FreeBSD installations.
The Linux versions uses libproc. The library is present on all Linux distros but
unfortunately most do not ship with the header files necessary to build it. You must
download the -devel or -dev package for libproc or procps to get the include files.
The OpenBSD version uses sysctl so there should be no issues.
How do I use it?
ProcAn has three modes, interactive, daemon, and pipe. In interactive mode procan will not detach from the shell and will
run in the foreground. There are several commands that you can issue to display running processes and interesting
processes. In daemon mode you will need to use one of the three backends (mail, syslog, and script) to control and
monitor the actions of the processes. In Pipe mode you can redirect the output of procan to another program or script,
In this mode, the output is not formatted for humans.
More detail can be found in the README included with the distribution.
0.8 - Improved the display, now uses an ncurses interface. Other small performance and stability improvements.
0.7 - Added Pipe/Plugin Mode, Further cleanup, provided some example plugins, SIGUSR1 resets statistics.
0.6 - Implemented libproc for the linux version, this alleviates some scalability issues.
User tracking is now supported on all platforms. Many bug fixes.
0.5 - First version with backend support! See the README in the archive for usage instructions.
I consider this to be the first beta release, and the previous versions to have been alpha releases.
0.4 - All of the memory leaks and errors reported by valgrind have been worked out.
This will be the last version without any backend support. I'm moving along :)
0.3 - Linux support has been added and works as well as the FreeBSD and OpenBSD
versions. Many memory allocation issues have been worked out, with just a few more to go.
0.2 - OpenBSD version no longer requires setgid. It now uses sysctl.
Seperated the collector module into os specific files.
Snapshot of HEAD in the Git repository
procan v0.8 (MD5) March 8th, 2008
procan v0.7 (MD5) August 23rd, 2006
procan v0.6 (MD5) April 30th, 2006
procan v0.5 (MD5) February 5th, 2006
procan v0.4 (MD5) January 9th 2006
procan v0.3 (MD5) January 7th 2006
procan v0.2 (MD5) December 30th 2005
Planned updates for 0.9:
-Revisit the analysis code to make it more robust.
-Add an option to let the plugin/pipe mode starts it's own process as well as supporting the pipe redirect output.
-Perform Audit for 1.0
-Improve the behavior of the curses interface
Where is the source code?
I use git as my SCM for procan, you can see it here: procan gitweb interface or clone the repository here: http://git.matburt.net/procan.git