Saturday 9 March 2013

Using "htop" to Monitor System Processes on Linux

htop allows you to monitor your system processes in real time text-mode graph. htop like top command but htop is quite colorful.

How to install htop on Centos

                [root@sysadmin ~]#   yum   install  htop

Using htop to monitor system processes

            [root@sysadmin ~]#  htop

When you start htop you will see a screen like the following


   
       Memory meter:

                           Green --> Used memory
                           Blue   -->  Buffer
                           Yellow --> Cache ( if you want to clear the cache memory see this link )

If you want to change default color then Press "F2"



You can also sort the process list  Press "F6". That screen like the following



If you want to kill any process without exit htop then select the process that needs to be killed from the list and Press "F9 " or  k. 



If you want to do " kill  -9 " on the selected process , select the "SIGKILL" from this menu and Press "Enter" ( Ex. One process is taking high memory if you want to kill that process at that time use this method )



You can able to view "lsof " output inside htop. If you want then Press "i" . That screen like the following.



If you want to change your htop setup then Press "F2"



       There are Four setup

             1. Meters              - Change the behavior  of the meter bar
             2.Display options - Customize the display options
             3. Colors               - Choose a clolor theme for the htop output
             4. Columns           - Choose what column needs to be displayed for the processes in the htop.


If you want to change refresh interval time of the htop

                [root@sysadmin ~]#  htop  -d  10
                   
           -d  ---> set the delay between updates
           10 ---> 10 seconds

If you want to see processes of  "Single user"

              [root@sysadmin ~]#  htop  -u  sysadmin

                       -u  --> show only processes of given user name
             sysadmin --> username

  The above command show only processes of Single user.

I hope you got some idea about htop.

No comments:

Post a Comment