It cannot replace long-term monitoring system. But it's a useful tool to help us find the most important information ASAP.
sudo apt-get install glances
yum install glances
if the vesion of glances installed by yum is too low, you could use this way to install newest.
curl -L http://bit.ly/glances | /bin/bash
glances --version Glances v2.3 with psutil v2.2.1
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"
To switch to per-CPU stats, just hit the 1 key
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."
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.
CPU% % of CPU used by the process If IRIX mode is off (aka Solaris mode), the value is divided by logical core number MEM% % of MEM used by the process VIRT Total program size - Virtual Memory Size (VMS) RES Resident Set Size (RSS) PID Process ID USER User ID NI Nice level of the process (niceness other than 0 is highlighted) S Process status (running process is highlighted) TIME+ Cumulative CPU time used IOR/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
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 detectedenter
hit enter key, then fill in process filter pattern, e.g. fill in nginx, only nginx process is shown
use argument –export-csv
glances --export-csv a.csv
official documentation
Created: 2016-02-02 二 10:37
Validate