歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

Use Glances on Linux

Use Glances on Linux

Table of Contents

1. why use glances2. install2.1. install on ubuntu2.2. install on Centos2.3. watch version3. statistical indicators3.1. cpu3.1.1. indicators3.1.2. warning3.1.3. switch3.2. load3.2.1. definition3.2.2. warning3.3. mem3.4. swap3.5. network3.6. disk3.7. file system3.8. process3.8.1. indicators3.8.2. switch4. export4.1. to csv file5. referer

1 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 install

2.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 could use this way to install newest.

curl -L http://bit.ly/glances | /bin/bash

2.3 watch version

glances --version
Glances v2.3 with psutil v2.2.1

3 statistical indicators

3.1 cpu

3.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 load

3.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 mem

3.4 swap

3.5 network

3.6 disk

3.7 file system

3.8 process

3.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 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

3.8.2 switch

  1. 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 export

    4.1 to csv file

    use argument –export-csv

    glances --export-csv a.csv
    

    5 referer

    official documentation

    Author: Dean Chen

    Created: 2016-02-02 二 10:37

    Validate

Copyright © Linux教程網 All Rights Reserved