Tweaking Tux, Part 5

As I write this, it is a foggy October day outside my window. But here, in this virtual meeting place, it is always sunny and warm (never rains till after midnight, as the song says) which can only mean that this is the SysAdmin's Corner. Pull up a chair, get comfortable and lend me your ear. It's time once again to dig deep into the mysteries of your Linux system, not because it is hard, but beca

Last time around, I thought I might wrap this series up, move on to something new. But then, out of nowhere, a reader sent me a seemingly harmless little e-mail. "Pssst. Hey, wanna see a really cool system monitor program? Free. GPL stuff even. Looks great. Waddayasay?" I thought, sure, couldn't hurt to have a look. Right?

You might remember that last time I told you about all those neat dockable apps I have scattered over my desktop--performance monitors, clock calendars, CD players and weather apps. It's one of things I think is really great about WindowMaker stuff. What I discovered at the end of that harmless e-mail was something like my favorite WindowMaker applet on steroids. Enough teasing. Do what I did. Surf on over to http://web.wt.net/~billw/gkrellm/gkrellm.html and get yourself a copy of GKrellM.

GKrellM is more than just a system performance monitor. Looking at it, I imagine a stack of stereo equipment components, separate tuner, amplifier, DVD, tape deck, etc. In this case, it displays time and date, CPU, processes in the run queue, disk activity, network interface stats, memory, swap, e-mail notification (complete with animated mail icon and Tux himself bouncing back and forth), and the list goes on. It's customizable and it's fun. There's more but, first, let's get this thing running.

Building GKrellM is easy. I downloaded the latest source (version 1.01) and built it like this.

     tar -xzvf gkrellm-1.0.1.tar.gz
     cd gkrellm-1.0.1
     make
     make install

If you feel like saving yourself the trouble of a compile, there are Debian and RPM packages available as well. Once you have the program installed (in whatever way you chose), simply type gkrellm & and you are off. Notice the image off to the right. This is not GKrellM's default look, but one of many skins that can be downloaded to change the look of the package. The one you see in my example is called "Sunset".

The official theme site for GKrellM is Muhri's web site at http://www.muhri.net, where you'll find enough GKrellM skins to keep you going for quite some time. There are over one hundred GKrellM skins on the site.

To install a theme, download the one you like, change directory to $HOME/.gkrellm/themes and extract the tarred and gzipped file like this:

     cd $HOME/.gkrellm/themes
     tar -xzvf /path_to/theme_name.tar.gz

To change the look of the monitor (and do any other customization), right-click on the menu bar. In my sunset image, the title bar says "scigate", the name of one of my servers. The menu pops up with "Configuration F1" or "Theme". I don't use the theme switcher here, but rather change things through the configuration menu. What the "Theme" menu does at this level is allow you to switch sequentially from one theme to another, either up or down. The configuration menu, on the other hand, displays them in a nice menu and allows you to choose any one and apply the changes until you are satisfied. You should also familiarize yourself with the built-in functions and change them to suit your own tastes and requirements.

I've told you about configuring themes, but you can do quite a bit more than that. A lot is packed into the display and some of that information is sitting just below the surface (whatever surface you happen to have selected). Clicking on the various "components" on the stack turns options on or off. For instance, if I click on the "Proc" display, it turns on and off a text display of the number of active processes and users. Similarly, if I click on the "eth0" network display, it shows the average transfer rate. Right-clicking yields different results than left-clicking, so explore.

Here's another great thing about GKrellM. There are plugins available that let you add functioanlity to the basic product. For instance, on my system, I have a plugin called GKrellWeather from Franky Lam. This little plugin adds another component to the GKrellM stack, a nice thin one that alternates between atmospheric conditions, temperature, dewpoint, wind speed, etc. All this information is gathered from my local airport weather station (code CYYZ).

Installing plugins is a little different. In the case of GKrellWeather, I downloaded the source, extracted it and ran make. The make install did all the work of installing the plugin. There are a number of plugins available with links from the GKrellM web site.

Now, I can't say that GKrellM has permanently cast out my other dockable apps. I still start WMmon, wmCalClock and wmWeather when the mood takes me. Their displays tend to be larger and, sometimes, easier to read. Still, this is one beautiful app, one I'll no doubt run in conjunction with other programs--such is my mania for dynamic system feedback. Scotty, I must have more stats!

Before we wrap this up, I want to throw one other command line monitor your way. ( I'll never give up the command line. Never!) From a shell prompt, type the command pstree. You should get something that looks like this.

 
init-+-apmd
     |-artsd
     |-atd
     |-crond
     |-fontfs
     |-gpm
     |-httpd---9*[httpd]
     |-identd---identd---3*[identd]
     |-inetd
     |-11*[kdeinit]
     |-kdeinit-+-kdeinit
     |         |-kdeinit-+-2*[bash---telnet]
     |         |         |-bash---su---bash---gkrellm
     |         |         |-bash---bluefish
     |         |         `-bash
     |         |-kdeinit---bash---su---bash---pstree
     |         `-kteatime
     |-kdeinit---cat
     |-kdesud
     |-kflushd

What's neat about this command is that you get a graphical view of what processes are running on your system and what process started those processes. For instance, you can see that kdeinit is responsible for a fair number of processes. From my KDE desktop, I started a bash shell and from that shell, I started GKrellM and bluefish, an HTML editor I'm pretty fond of. The display is somewhat longer than what you see here, but I've trimmed it down a bit. You can also see from here that all processes start with "init", which is process ID 1.

You can modify the display with switches. For instance, a "-G" will show you the same display but with nice graphical lines instead of the dashed ones you see above. An "-a" flag will display all command line arguments. By default, pstree only displays the command name. Here's a small sample with no flags set.

|-sendmail
     |-smbd---3*[smbd]
     |-syslogd
     `-xfs 

Here is the same display with the "-a" option set.

 |-sendmail
 |-(smbd)
 |   |-smbd -D
 |   |-smbd -D
 |   `-smbd -D
 |-syslogd -m 0
 `-xfs -droppriv -daemon -port -1 

The smbd process now shows the parent process in parentheses, which indicates that the process is swapped out. Notice also that all three of its children are visible while they were only flagged as "3*" before. Similarly, have a look at the xfs command that now displays all the flags with which it was called. The ps command is great for telling you every little thing that is going on, but pstree provides you with a graphical, hierarchical means of finding that information.

I started out this column with the hint that next time we are going to do something different and, this time, I mean it. So, be sure to tune in for something completely, er, um, different. Until then, remember to give Tux a tweak. You both might enjoy it.

______________________

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix