Some Basics of RedHat Linux System Administration

Linux System Administration
What is Running on Your System  
 
From time to time (once a day or two), it is a good idea to see what is running on your system, and to ensure that there are no runaway processes chewing up a lot of your CPU time.

The simplest way to do this is to run a top command as follows:

top

The output on my system looks like the following:
  10:56am  up 13 days, 23:48,  2 users,  load average: 0.00, 0.00, 0.00
54 processes: 53 sleeping, 1 running, 0 zombie, 0 stopped
CPU states:  0.3% user,  0.3% system,  0.0% nice, 99.2% idle
Mem:    62936K av,   61396K used,    1540K free,   11076K shrd,   31856K buff
Swap:  104384K av,   12096K used,   92288K free                   13896K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
21806 root       1   0  1664 1600  1308 S     0.3  2.5   0:00 sshd
21907 kern       8   0   952  952   752 R     0.1  1.5   0:00 top
21908 root      10   0   860  860   728 S     0.1  1.3   0:00 sh
    1 root       0   0   104   68    48 S     0.0  0.1   0:06 init
    2 root       0   0     0    0     0 SW    0.0  0.0   0:05 kflushd
    3 root       0   0     0    0     0 SW    0.0  0.0   0:14 kupdate
    4 root       0   0     0    0     0 SW    0.0  0.0   0:00 kpiod
    5 root       0   0     0    0     0 SW    0.0  0.0   0:10 kswapd
    6 root     -20 -20     0    0     0 SW<   0.0  0.0   0:00 mdrecoveryd
  164 root       0   0    64    0     0 SW    0.0  0.0   0:00 apmd
  396 root       0   0   220  160   124 S     0.0  0.2   0:00 syslogd
  406 root       0   0   352    0     0 SW    0.0  0.0   0:00 klogd
  421 rpc        0   0    88    0     0 SW    0.0  0.0   0:00 portmap
  437 root       0   0     0    0     0 SW    0.0  0.0   0:00 lockd
  438 root       0   0     0    0     0 SW    0.0  0.0   2:27 rpciod
  448 rpcuser    0   0   120    0     0 SW    0.0  0.0   0:00 rpc.statd
 
What is important to note here is whether or not there is a process that is consuming a lot of time. In this case, we see from the second line of the output that there are a total of 54 processes, of which 53 are sleeping and one is running, there are no zombies and none stopped. This is typical for my system. Also, I note that the CPU is 99.2% idle. Looking in detail at the list of processes running, we see that sshd (the secure shell daemon) was using 0.3% of the CPU and top was using 0.1% of the CPU. This is normal. If you find that a program is consistently using more than 5 or 10% of the CPU over a 5 minute period, you should investigate more thoroughly.

Note, depending on your system, things could be drastically different. For example, if you have a database application with lots of users logged-in, you could expect that this program will consume a lot of the CPU and Memory resources, the same would be true for a busy Web Server.

Checking For Available Disk Space  
 
The simplest way to quickly check your available disk space is to do:

df The output on my machine looks like the following:

 Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hda1               995115    130272    813437  14% /
/dev/hda5              2478138   1945076    404946  83% /home
/dev/hda6              2478138   1251961   1098061  54% /usr
/dev/hdc              19729380     36148  18691028   1% /files
 
What is important to check here is the Use% column which indicates how much of the disk partition is being used. Generally, if it is more than 80%, you will need to monitor it closely to ensure that the partition does not completely fill. In that case, programs will begin to error, and you may loose data.

I recommend that you run this command (df) soon after you have just installed your system, and save a copy of the output in a file. That way, at a later time, you can compare the disk usage and check for any abnormalities.
 

To be continued ...
Resources on the next page ...

Page 8 of Install Page 1 of Resources Home

Home: http://www.sibbald.com/
Contact: kern at sibbald dot com
Last Update: