Htop là một công cụ theo dõi tổng quan về hệ thống theo thời gian thực (mặc định 3s refresh 1 lần) về CPU, RAM, processs ….
htop là 1 phiên bản cải tiến của top, ưu điểm của htop này là:
1. Giao diện trực quan sinh động hơn
2. Hiển thị load của từng CPU đối với server có nhiều CPU.
3. Hỗ trợ sử dụng mouse so với top.
4. Có thể kill process 1 cách đơn giản không cần truyền pid như top.
Để cài đặt htop trên Server Linux CentOS/Ubuntu bạn làm theo các bước sau
Bước 1: Cài đặt phiên bản EPEL mới nhất
Đối với RHEL/CentOS 32bit
# wget https://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm # rpm -ihv epel-release-6-8.noarch.rpm
Đối với RHEL/CentOS 64bit
-------------- For RHEL/CentOS 7 -------------- # wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm # rpm -ihv epel-release-7-10.noarch.rpm -------------- For RHEL/CentOS 6 -------------- # wget https://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ihv epel-release-6-8.noarch.rpm
Đối với Ubuntu bạn không cài đặt EPEL. Lưu ý bạn phải cài đặt wget
yum install wget -y
Bước 2: Cài đặt htop
2.1: Cài đặt bằng lệnh
Đối với RHEL/CentOS
yum install htop -y
Đối với Ubuntu
apt-get install htop
2.2: Cài đặt từ Source
Đối với RHEL/CentOS bạn chạy các lệnh sau
# yum groupinstall "Development Tools" # yum install ncurses ncurses-devel # wget https://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz # tar xvfvz htop-2.0.2.tar.gz # cd htop-2.0.2
Đối với Ubuntu
$ sudo apt-get install build-essential $ sudo apt-get install libncurses5-dev libncursesw5-dev $ wget https://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz $ tar xvfvz htop-2.0.2.tar.gz $ cd htop-2.0.2
Sau khi tải về bạn truy cập vào thư mục htop và chạy các lệnh sau để Complie và cài đặt
# ./configure # make # make install
Để sử dụng htop bạn chạy lệnh “htop”