Use Glances on Linux
Use Glances on LinuxTable of Contents1. why use unzip install2.1. install on your watch version3. statistical unzip cpu3.1.1. unzip your switch3.2. load3.2.1. then upload your own faster than network3.6. your file has been downloaded before export4.1. referer1 why use glances
It cannot replace long-term monitoring system. But it's a useful tool to help us find the most important information ASAP.
2 install2.1 install on ubuntu
sudo apt-get install glances
2.2 install on Centos
yum install glances
If the vesion of glances installed by yum is too low, you can use this way to install newest.
curl -L http://bit.ly/glances | /bin/bash
2.3 watch version
glances --versionGlances v2.3 with psutil v2.2.1
3 statistical indicators3.1 cpu3.1.1 indicators
Table 1: cpu indicators
| Indicator |
Description |
| User |
|
| System |
|
| Idle |
|
| Nice |
|
| Irq |
|
| Iowait |
|
| Steal |
|
3.1.2 warning
If user|system CPU is <50%, then status is set to "OK"If user|system CPU is >50%, then status is set to "CAREFUL"If user|system CPU is >70%, then status is set to "WARNING"If user|system CPU is >90%, then status is set to "CRITICAL"
3.1.3 switch
To switch to per-CPU stats, just hit the 1 key
3.2 load3.2.1 definition
On the No Sheep blog, Zachary Tirrell defines the load average: "In short it is the average sum of the number of processes waiting in the run-queue plus the number currently executing over 1, 5, and 15 minutes time periods."
3.2.2 warning
Glances gets the number of CPU core to adapt the alerts. Alerts on load average are only set on 15 minutes time period. The first line also displays the number of CPU core.If load average is <0.7*core, then status is set to "OK"If load average is >0.7*core, then status is set to "CAREFUL"If load average is >1*core, then status is set to "WARNING"If load average is >5*core, then status is set to "CRITICAL"Note: limit values can be overwritten in the configuration file under the [load] section.
3.3 mem3.4 swap3.5 network3.6 disk3.7 file system3.8 process3.8.1 indicators
CPU% % of CPU used by the process If IRIX mode is off (aka Solaris mode), the value is divided by logical core numberMEM% % of MEM used by the processVIRT Total program size - Virtual Memory Size (VMS)RES Resident Set Size (RSS)PID Process IDUSER User IDNI Nice level of the process (niceness other than 0 is highlighted)S Process status (running process is highlighted)TIME+ Cumulative CPU time usedIOR/s Per process I/O read rate (in Byte/s)IOW/s Per process I/O write rate (in Byte/s)COMMAND Process command line User cans switch to the process name by pressing on the / key
3.8.2 switch
- A key
By default, or if you hit the a key, the processes list is automatically sorted by: CPU if there is no alert (default behavior) CPU if a CPU or LOAD alert is detected MEM if a memory alert is detected Disk I/O if a CPU iowait alert is detected
Enter
Hit enter key, then fill in process filter pattern, e.g. fill in nginx, only nginx process is shown
4 export4.1 to csv fileUse argument-export-csv
glances --export-csv a.csv
5 refererOfficial documentation
Author: Dean Chen
Created:
Validate