How To Use Some Monitor Server Resources such as top, htop Part:1

Introduction:

To perform computer system for proper administration and monitoring.

How to monitor system Processes.

top

One of the most common tools to check the resource utilization of processes is “top“.

Command:

top

Output:

q

The top portion has some system statistics, including load averages for last 1 minute, 5 minutes, and 15 minutes. It also shows memory and swap usage and count of various process states.

The bottom portion has every process on the system and organized by the top users of resources. This list is updated in real-time.

htop

Although “top” is included in almost every distribution by default and an improved version of top which called “htop” is available for download from most repositories. It will show the real-time live processes running and working.

To install htop on Ubuntu, type the following:

Command:

sudo apt-get install htop

2

Command:

htop

Output:

3

 

Here are some keys that will help to use htop more effectively:

  • M: Sort processes by memory usage
  • P: Sort processes by processor usage
  • ?: Access help
  • k: Kill current/tagged process
  • F2: Setup htop. You can choose display options here.
  • /: Search processes

 

How Do I Find Out How Much Disk Space I Have Left?

df

For a quick overview of how much disk space have left in drives we can use  “df” command.

Command:

df

Output:

4

If we want to see the total disk space available on all file systems, we can pass the “–total” option. This will add a row at the bottom with summary information:

If want see the output of the disk fragmentation in a human readable so you can use the command.

Command:

df -h

Output:

5

How to find the space of the memory and its usage.

free

The easiest way of finding out the current memory usage on your system with “free” command.

When used without options the output looks like below:

Command:

free

Output:

6

If need to see the output in human readable then use -h parameter.

Command:

free -h

output:

7

To display in a more readable format we can pass the “-m” option to display the output in megabytes:

Command: 

free -m

Output:

8

Conclusion

Using these tools we will be able to monitor server from the command line. There are many other utilities that perform simple monitoring operations.

Leave a Reply

Your email address will not be published.