Linux

Monitor your Linux box with the Gnome Workstation Command Center

Have you ever had to run a million or so commands on a Linux box to ascertain the status of one process or another? If so, then you will appreciate the Gnome Workstation Command Center. In this Daily Feature, Jack Wallen, Jr., shows you the ropes.

It seems every operating system, distribution, desktop environment, and window manager has its own collection of administrative utilities labeled a “command center.” Even many applications have gotten into the act. From the Windows Management Console to the Mandrake Command Center to YaST2, they just pop up like bugs in Windows beta code.

Most of these command centers do the same old thing: configure desktops, configure networking, configure sound, configure printing, blah, blah, blah. But every once in a while, one comes along that's a bit different and deserves your attention. One such toolkit is the Gnome Workstation Command Center (gwcc). This time around, we're talking not so much about configuring as we are about monitoring. In this Daily Feature, we'll take a look at installing gwcc and what it can do for you.

Getting and installing
The gwcc is quite simple to install. To show you how simple the installation can be, we are going to use the Red Hat Package Management System so you will only have to download the latest .rpm file from Sourceforge—as of this writing, the latest stable release is 0.9.5-1—and then, as root, run the command:
rpm -ivh gwcc-0.9.5-1.i386.rpm

If you have a penchant for installing from source, you're in luck! Grab the latest tar file and, again as root, run the following commands, beginning in the directory in which you downloaded the tar file:
mv gwcc-0.9.5.tar.gz /usr/local/bin
tar xvfz gwcc-0.9.5.tar.gz
cd gwcc-0.9.5
./configure
make
make install


These commands install the command center’s executable binary in the /usr/bin directory. You run gwcc as root, but you'll have to su to root in the following way:
su -

to get full functionality from gwcc. Enter the root password and then run the command gwcc. You’ll see the command center’s main window, shown in Figure A.

Figure A
The gwcc offers five tabs that give you information on the local Linux box and network performance.


So what does it do?
Okay, so you’ve laid the groundwork and installed the command center. Now, what does this thing do? Well, it does a number of things that you might expect, from killing rogue processes to tracing packet routes. But first and foremost, it generates tons of reports about the system where it is installed. From networking status to used disk space to process control, you’ll find a great deal of necessary data for the administrator’s job located in one graphical interface. The command center has five tabs that offer various services.

The Workstation Utils tab
As shown in Figure A, the gwcc opens to the Workstation Utils tab, where you can generate numerous reports, all of which replicate the results of standard Linux commands:

gwcc report Command-line equivalent
Network Interface /sbin/ifconfig with no switches or arguments
Network Status netstat
Free Disk Space df
Printer Queue lpq
Env Variables env with no switches
Show Path echo $PATH
Show Users w with no switches

The Network Utils tab
The Network Utils tab is a rather handy place to do some cursory troubleshooting. From this tab, you can run the commands:
  • ping—Sends ICMP ECHO_REQUEST packets to network hosts (If you are using a newer distribution, such as Red Hat 7.1, you’ll notice that this command has issues with the default settings. You’ll have to select Settings | Preferences to change the numeric values for the -c,-w, and -i settings. Change these settings to other values and then change them all back to 1. You should find they now work as desired.)
  • whois—Sends queries to a whois or nicname database
  • nslookup—Queries Internet name servers interactively
  • traceroute—Determines the path a packet takes to a given destination
  • finger—Ascertains information, such as login name, real name, terminal name, and write status, about a user

The above commands comprise a fairly complete set of basic network administration tools that should help you handle most of your initial network troubleshooting.

To use the Network Utils tab, simply select the tool you wish to use from the Network Operation/Host drop-down box, enter the address into the right drop-down box, and click OK. Your report will be generated in the Result text area.

Figure B
Running traceroute is very simple in gwcc.


As you can see in Figure B, I ran the traceroute command on the address www.techrepublic.com. The information returned outlined the route the packet took from my machine to the final destination. One odd aspect of this tab is that you can’t actually save the commands’ output. (This is a variance from the Workstation Utils tab, where any output generated can be saved to a file for later perusal.) The gwcc’s Preferences window does offer a number of settings to configure, but none of them will aid you in getting Network Utils tab results saved to a file. To save these tests, you will have to manually (gasp!) copy and paste the results into a file.

The Process Grep tab
The next tab, Process Grep, allows you to pass text to the grep command to reveal which processes are running on the local machine. As you can see in the results shown in Figure C, I first entered the text su, for the su command, in the ps | grep drop-down box. On my machine, the Process Grep tab returned two running instances of the su command. My next entry was bash; according to gwcc, two instances of bash (IDs 26382, 26773) were running. What do you know? It was right.

Figure C
Is bash running on your system? To find out, enter bash in the ps | grep drop-down box and click OK.


The Process Control tab
The Process Control tab lets you view all processes currently running on the system and send various signals to those processes. As shown in Figure D, the tab allows you to act on an individual process by selecting the process from the list and the action from the drop-down box.

Figure D
The Process Control tab lets you pass signals to various processes on your system.


The process-level action sends a process one of three signals:
  1. SIGHUP causes the kernel to tell the process that the terminal in which it is running has been closed. HUP stands for hangup.
  2. SIGTERM instructs a process to terminate gracefully. TERM stands for terminate.
  3. SIGKILL kills a process immediately. It is more forceful than graceful and should be used only on processes that refuse to die. KILL, obviously, stands for kill.

To send a signal to a process, first select a process in the Process Display window. Then, choose the desired signal from the Process Signals drop-down box and click OK.

Unlike the top command, the gwcc Process Control tab does not automatically update its display. To update your process list display, you have to click the Apply button in the Refresh Display area.

The System Stats tab
The System Stats tab reports various statistics about your system. As you can see in Figure E, this information includes your workstation’s IP address, how much of your memory and disk space is used, uptime, Apache status, Samba status, Sendmail status, kernel version, hardware information, user information, and process summaries. There are no configuration options for this tab.

Figure E
To get this information, you’d have to run nine different commands.


Minimal configuration
One of gwcc’s main drawbacks is the fact that it offers few configuration options. Those that are available are found in the Preferences window, shown in Figure F, which you open from the Settings menu.

Figure F
All gwcc configuration changes are made within the Preferences window.


In the Preferences window, you will see a tab for nearly all the options in the main gwcc window. Nearly all—the Process Control and System Stats tabs are conspicuously absent. Most configuration options are simply switches you apply to the various commands. For instance, in the Workstation Utils configuration tab, you can apply the -arp (arpnet style addressing) switch to the Network Interface Operation.

A known bug with the Preferences window
One word of warning: Should gwcc crash once, you’ll find that simply opening the Preferences window will continually crash the command center. To get around this bug, you need to delete the file /root/.gwcc/prefs.conf and restart the application. By deleting gwcc’s configuration file, you will force gwcc to generate a new prefs.conf file, thereby losing any prior configuration changes.

One of the handier configuration options is on the Network Utils tab. Under ping Options, you can set the -c (count) switch, the -w (waitsec) switch, and the -i (interval) switch.

I like to set two other options on the General tab. The first is Append New Output To Existing File, which does not overwrite the files you previously saved. Instead, it adds new output to the end of the file. My other preferred option is Add A Timestamp To The End Of Saved Files. By adding this timestamp, you will be able to keep a much better record of what your system has been doing and how it’s performed over time.

Conclusion
If you’re looking for a centralized location to keep track of system information, then gwcc might be the tool for you. This single tool takes care of 24 different commands, making them simple to use and far easier to remember.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

0 comments