码迷,mamicode.com
首页 > 系统相关 > 详细

Use Glances on Linux

时间:2016-02-02 15:11:06      阅读:386      评论:0      收藏:0      [点我收藏+]

标签:

Use Glances on Linux

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
indicatordescription
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
    
  2. 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

Author: Dean Chen

Created: 2016-02-02 二 10:37

Validate

Use Glances on Linux

标签:

原文地址:http://blog.csdn.net/csfreebird/article/details/50622578

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!