Getting to Know You...My Kernel

Marcel Gagné

Issue #97, May 2002

Marcel shows you different ways of looking at the Linux kernel from the outside.

François, mon ami, are you still listening to that Vorbis broadcast of the Linux kernel on Free Radio Linux? While I admire your determination to get to know the Linux kernel intimately for this month's issue, the entire transmission will take months. There are more interesting ways to get close to your kernel, François, and you will not look so lost, mon ami. Besides, our guests will be here soon and we must be ready.

Ah, bonjour, mes amis! It is so good to see you. Welcome to Chez Marcel, home of fine Linux fare, great wine, good food and excellent company—your company, mes amis. Please, sit and make yourselves comfortable. My faithful waiter, François, will run to the cellar and bring back the wine. We have some 1999 Cornas Champelrose that will be an excellent wine for today's menu.

And speaking of the menu, I would like you to think of tonight's menu as a kind of buffet or smorgasbord of little finger foods, small but very useful applications with which you can pepper your desktop. Ah, François, you are back. Wonderful. Please, pour for our guests.

Before you arrived, mes amis, I was telling François that getting to the heart of the Linux kernel is sometimes best done by looking at it from the outside. After all, your kernel is the heart and soul of your Linux system, not to mention the engine that drives all other applications. One way to appreciate what your system is doing is through the use of system monitors. Now, as you already know, there are literally hundreds of such programs, so where do we start? In my Linux kitchen, I run different desktops from time to time, most notably Window Maker and KDE. I am particularly fond of KDE's power and beauty, but Window Maker has a special place in my heart as well, specifically its elegant dock applications. These small programs in 64 × 64 pixel squares come in every variety, including a host of system and resource monitors.

For instance, check out Vito Caputo's WMSysMon (originally created by Dave Clark) at www.gnugeneration.com/software/wmsysmon. This little monitor provides visual feedback on memory use, swap use and percentage of I/O, as well as interrupts and pages being swapped in and out. It's a lot to pack into this small monitor, but seeing it in action (Figure 1) will give you an idea of what to expect.

Figure 1. WMSysMon tells all!

Building this little application takes nothing more than extracting the source, moving into the application directory (wmsysmon-0.7.6/src) and executing a make followed by a make install.

To fire up this little monitor, simply run the command wmsysmon. You have the option of running the interrupts display as a meter or with nice LED-style blinking lights. Mes amis, I must tell you that what originally excited me about computers all those years ago was the important-looking display of blinking lights. Consequently, I run WMSysMon with the -l option.

You must admit, mes amis, that although WMSysMon looks very professional, when we cook with Linux, we occasionally lean toward lighter fare, non? If WMSysMon is too serious a monitor for you, consider BubbleMon-dockapp available at timecop's web site, www.ne.jp/asahi/linux/timecop.

Mes amis, I am going to pretend that you will find this program useful and immediately tell you how to build it:

tar -xzvf bubblemon-dockapp-1.4.tar.gz
cd bubblemon-dockapp-1.4
make
make install

To run the program, type bubblemon. Several people have worked on various incarnations of a bubbling resource monitor applet, but the real genius here is the inclusion of a cute little yellow duck swimming across the top of a bubbling pond. The more your system is doing, the more bubbles rise to the surface. As you start to run out of memory, the water level will rise until your duck disappears from sight.

Figure 2. No, the duck tells all.

Move your mouse over the BubbleMon-dockapp, and your duck and pond will slowly fade to be replaced by a CPU usage graph complete with run average stats for the last 5, 10 and 15 minutes. Here's another tip. If you right click on the monitor while your duck is fading, you can capture an image in transition. In other words, you can see a ghostly image of your duck swimming across your CPU graph. It is possible to disable the swimming duck with the -d option, but why would you want to do such a thing? Ah, levity.

Of course, your kernel is busy doing other things as well, dealing with users, running processes, dealing with e-mail, web server requests and other internet connections. WMiNet is a Window Maker application created by Dave Clark, Antoine Nulle and Martijn Pieterse. Its purpose is to monitor (among other things) various network connections, processes and users. WMiNet is available at www.neotokyo.org/illusion.

Figure 3. WMiNet, keeping an eye on things.

After you have extracted the source using tar -xzvf wminet-2.0.3.tar.gz, change to the wminet.app/wminet directory and do a make followed by a make install. The install will create a configuration file in /etc/wminetrc, where you can define what specific system processes the monitor watches. What I find particularly interesting with this one is that each of the five display lines can be configured for a single-click command. For instance, in position 1, I have a listing of active processes. If I click that line, it automatically launches top. Here's a sample from my own /etc/wminetrc file. I think you will find it is basically self-explanatory:

action1=rxvt -bg black -fg white -e top
action2=rxvt -bg black -fg white -e sh -c "w; read"
action3=rxvt -bg black -fg white -e sh
-c "netstat -etpn; read"
action4=rxvt -bg black -fg white -e tail
-f /usr/local/apache/var/logs/access_log
action5=rxvt -bg black -fg white -e sh -c "df -k;read"

When I have looked at these little Window Maker dock applications in the past, I have mentioned that you can run them on other desktops as well. When running them on something like KDE, however, there is the downside of all those processes open in the taskbar and the frameless nature of the applications themselves. They work just fine, but they lack the elegance of Window Maker's dock that swallows the applications, thus making for a clean collection of windows into your system's soul.

Thanks to Henning Burchart and the Kappdock, KDE users need no longer feel left out. This little tool sits quietly in the corner, waiting for you to attach and swallow all those Window Maker applications. Kappdock also places a little icon in KDE's icon tray. One click banishes all the running applications from your sight. One more click and they are back. I will show you how to work with it momentarily, but for now start by visiting Henning's web site at www.informatik.uni-oldenburg.de/~bigboss/kappdock.

Extract and build the source using the familiar extract, configure and make method:

tar -xzvf kappdock-0.44.tar.gz
cd kappdock-0.44
./configure
make
make install

Start Kappdock in the background by running it from the shell or launch it by pressing Alt-F2. You should see an innocuous little square on your screen with a small striped bar across the top and a black arrow to the right of that bar. (Notice as well the new icon in your KDE icon tray.) The bar actually is called the drag bar (because you can use it to drag your applications to any position on the desktop). I prefer to think of it as the dock itself. Clicking on the black arrow will cause kappdock to disappear from your desktop. Clicking on the tray icon will bring it back. So how do you attach applications? Please allow François to refill your glasses and I shall demonstrate.

Begin by right clicking on the single square you see attached to the dock. You can either select to edit the existing square or add a new one. If you right click the drag bar, you will get the option of either adding a new app or changing Kappdock's preferences. Some of these options include the position of the dock and the orientation of docked applications. To add an application, click New. You'll see a dialog box similar to the one in Figure 4.

Figure 4. Adding an Application to Kappdock

If you have an application already running (from the previous examples), you simply can click on the Select button. Your mouse pointer will change to a set of crosshairs. Move the crosshairs over to your running application, click and voilà!, your application is docked. Optionally, you simply can type in the information yourself. Have a look at Figure 5 for a well-stocked Kappdock.

Figure 5. Busy Kappdock keeps KDE looking clean.

There you have it, mes amis. The clock (in this case, wmCalClock), she is telling us that closing time approaches once again. It is time to finish your wine and perhaps try out one last program. If you just can't seem to get your fill of dock applications, head on over to Ben Sinclair's Dock App Warehouse at www.bensinclair.com/dockapp.

This is a well-thought-out web site with tons of Window Maker dock applications. The graphical list of applications means that while you cannot judge an application by its graphic, you certainly can let your imagination go wild. There should be more than enough here to satisfy your appetite for quite some time.

On my own desktop, I run weather applications, clocks, graphical do-nothings, power monitors, moon, sun and space weather monitors—all these in addition to classic system resource monitors. The design of these little programs means they take up very little of your precious desktop space. Thank you once again, mes amis. Your visit to Chez Marcel is always a pleasure. Until next month. A votre santé! Bon appétit!

Resources

Marcel Gagné (mggagne@salmar.com) is president of Salmar Consulting, Inc., a systems integration and network consulting firm, and the author of Linux System Administration: A User's Guide, published by Addison-Wesley.