Linux / Centos common supervisory command

top command

The top command is a performance monitoring program that can be used in many Linux / Unix version, system performance monitoring tools for Linux system administrators and it is also frequently used. Top command to display all running on a regular basis and the actual operation and updates to the list, it shows CPU usage, memory usage, swap memory, cache size, buffer size, process control, and more user command. It also displays memory and CPU usage of running processes. When we need to monitor and take corrective action against Linux systems, top command is very useful for system administrators. Let's look at the actual operation of the top command.

The implementation of a common view of the top command is as follows:
Linux / Centos common supervisory command
htop command

htop is an interactive process under Linux browsers, can completely replace the previous section talked about the top command, compared with the top command, htop command has the following advantages:

Direct support for mouse clicks (do not ask you 6 6!)

Screen horizontal scroll vertically, like a window

Can track the process, show the process open files

Support for the process of tree view display

Find support processes by name

Installation command: yum install htop

In short visualization has done 66, we come to experience:
Linux / Centos common supervisory command
that the plan is divided into three parts:

Top is an overview of resource usage, which looked at the progress bar on the very cool

The middle is similar to the process table, and the top command

The following is a clear operational guidelines and shortcuts

Next we look at some of the graphical user:

Process tree view
Linux / Centos common supervisory command
click on a variety of indicators to sort
Linux / Centos common supervisory command
function
Linux / Centos common supervisory command
Linux / Centos common supervisory command
htop commonly used function keys 

            F1 : 查看htop使用说明
            F2 : 设置
            F3 : 搜索进程
            F4 : 过滤器,按关键字搜索
            F5 : 显示树形结构
            F6 : 选择排序方式
            F7 : 减少nice值,这样就可以提高对应进程的优先级
            F8 : 增加nice值,这样可以降低对应进程的优先级
            F9 : 杀掉选中的进程
            F10 : 退出htop

            / : 搜索字符
            h : 显示帮助
            l :显示进程打开的文件: 如果安装了lsof,按此键可以显示进程所打开的文件
            u :显示所有用户,并可以选择某一特定用户的进程
            s : 将调用strace追踪进程的系统调用
            t : 显示树形结构

            H :显示/隐藏用户线程
            I :倒转排序顺序
            K :显示/隐藏内核线程   
            M :按内存占用排序
            P :按CPU排序   
            T :按运行时间排序

            上下键或PgUP, PgDn : 移动选中进程
            左右键或Home, End : 移动列表   
            Space(空格) : 标记/取消标记一个进程。命令可以作用于多个进程,例如 "kill",将应用于所有已标记的进程

iotop 命令

iotop 是用来监控硬盘 IO的使用情况,UI 界面和 top类似,其中包括 PID、用户、I/O、进程 等相关信息。

Linux 下系统自带的IO统计工具如 iostat,nmon等大多数是只能统计到 per设备的读写情况,如果你想知道每个进程是如何使用 IO的就比较麻烦,使用 iotop命令可以很方便的查看。
Linux / Centos common supervisory command
iftop 命令

iftop 是Linux系统的流量和带宽监控工具,可用于查看实时的网络流量、监控TCP/IP连接等,也是非常有用的!

我们来做一下实验,命令执行后效果如下:
Linux / Centos common supervisory command
Linux / Centos common supervisory command
iftop 命令常用的参数如下,这里做个小规模总结:

-i 设定监测的网卡,如:# iftop -i eth1

-B 以bytes为单位显示流量 (默认是bits),如:# iftop -B

-n 使 host信息默认直接都显示 IP,如:# iftop -n

-N 使端口信息默认直接都显示端口号,如: # iftop -N

-F 显示特定网段的进出流量,如 # iftop -F 10.10.1.0/24 或 # iftop -F 10.10.1.0/255.255.255.0

-h(display this message),帮助,显示参数信息

-p 使用这个参数后,中间的列表显示的本地主机信息,出现了本机以外的IP信息;

-b 使流量图形条默认就显示;

再来总结一下,进入 iftop 视图画面后的一些操作命令 (注意大小写):

按 h切换是否显示帮助;

N switch the display by IP or host name of the machine;

S host by switching whether to display information on the machine;

D by host switching whether to display the information of the distal end of the target host;

T switch the display format by 2 lines / 1 line / flow rate shows only transmit / receive traffic only display;

N switch the display by port number or service name;

S by switching whether to display the port information of the client;

Toggle display D by the distal end of the target host port information;

Press p switch port information is displayed;

Press P switch suspend / resume display;

B by switching whether to display the graphic bar average flow rate;

T by switching whether to display the total flow of each connection;

L Open the screen by filtering the input to filter characters, such as ip, press Enter, the screen displays only the IP relevant traffic information;

L scale display screen by switching the upper side; different scales, there will be changes in flow pattern strip;

Press j or k can scroll down by connecting up a screen display or recording;

Press 1 or 2 or 3 can be sorted according to three traffic data displayed to the right;

Press <machine name according to the sorted IP or left;

Press> The name of the remote host or destination host IP sort;

O is fixed or switched by simply displays the current connection;

If you are interested or have questions to ask, please add: 15149813470, free answer.

Guess you like

Origin blog.51cto.com/11233498/2405147