Use of the glances tool for process management in linux
The previous blog post introduced the use of the htop tool. Here we will introduce the use of the glances tool. I personally prefer this tool, the main reason is that glances can export the system status as a file. If it is exported as an html format, it can work with web programs such as apache or nginx to directly open the webpage to view server resources.
Since there are advantages, there are also disadvantages. You cannot select a specific process to be viewed through the up and down arrows, nor view all processes. It can only display processes that occupy a large amount of system resources. However, it can view the network, disk read/write, and disk partition of the current computer.
Glances official home: http://nicolargo.github.io/glances/ here can download the corresponding source package
Here is the interface opened by glances. I have hidden the disk read/write. If it is not hidden, the disk I/O is displayed in the lower left corner instead of the current MOUNT.
Let's talk about common glances options:
-F/path/to/somefile: Set the location of the output file.
-O {html/csv}: sets the output file format.
-M: Hide the mounted Disk
Some common options can also be used directly on the visual interface, for example, the following
-B: displays the NIC speed in bytes.
-D: Hide disk IO
-N: Hiding network I/O
-T: Specifies the refresh interval.
-1: Data of each cpu is displayed separately.
Next, we will give a demonstration of the above content.
Let's demonstrate the output file first. This is awesome ..... note that-o and-f must be used at the same time.-o specifies the export type.-f specifies the export location (I export it to the web directory) after executing this command, the program will generate a glances.html file in the/var/www/htmldirectory and the program will continue to run normally.
Execute: (there is no way to demonstrate the dynamic graph here. Please try it yourself .)
Go to glances to get help information. In the lower-left corner of glances, you will be prompted to press h to get help (I am using ubuntu here and will display Chinese characters)
After seeing this figure, many friends with poor English can see hope .. The following parameters are highlighted only by the color. They represent three levels: Attention, warning, and critical. (In fact, when it reaches the third level of visual testing, it fails .. Can be understood as the end)
Next, the limits are represented respectively. Therefore, pay attention to the system usage. When the limit is exceeded, pay attention to it. Suddenly, I Don't specify how to write it. You don't need to demonstrate this. Ah. I want to write more, but I don't know how to write it. Forgive me.