Linux性能监控工具:Glances部署实录

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux性能监控工具:Glances部署实录相关的知识,希望对你有一定的参考价值。

[[email protected] ~]# yum install -y zlib zlib-devel bzip2 bzip2-devel ncurses ncurses-devel readline readline-devel openssl openssl-devel openssl-static gdbm gdbm-devel sqlite sqlite-devel
[[email protected] ~]# tar zxvf Python-3.6.1.tgz
[[email protected] ~]# cd Python-3.6.1
[[email protected] Python-3.6.1]# ./configure --prefix=/usr/local/python
[[email protected] Python-3.6.1]# make
[[email protected] Python-3.6.1]# make install
[[email protected] ~]# rm -rf /usr/bin/python
[[email protected] ~]# ln -s /usr/local/python/bin/python3.6 /usr/bin/python
[[email protected] ~]# ll /usr/bin/python
lrwxrwxrwx 1 root root 31 Mar 16 05:47 /usr/bin/python -> /usr/local/python/bin/python3.6
[[email protected] ~]# python -V
Python 3.6.1


[[email protected] ~]# which yum
/usr/bin/yum
[[email protected] ~]# vi /usr/bin/yum
#!/usr/bin/python2.6


[[email protected] ~]# tar zxvf psutil-5.4.3.tar.gz
[[email protected] ~]# cd psutil-5.4.3
[[email protected] psutil-5.4.3]# python setup.py install


[[email protected] ~]# vi /etc/profile
PATH=$PATH:/usr/local/python/bin
[[email protected] ~]# source /etc/profile


[[email protected] ~]# pip3 install glances
Collecting glances
  Downloading Glances-2.11.1.tar.gz (5.7MB)
    100% | 5.7MB 18kB/s 
Requirement already satisfied: psutil>=2.0.0 in /usr/local/python/lib/python3.6/site-packages/psutil-5.4.3-py3.6-linux-x86_64.egg (from glances)
Installing collected packages: glances
  Running setup.py install for glances ... done
Successfully installed glances-2.11.1


[[email protected] ~]# glances
king01 (CentOS 6.5 64bit / Linux 2.6.32-431.el6.x86_64)                                                                                                        Uptime: 4:49:23
CPU  [|                                             3.2%]   CPU       3.2%  nice:     0.0%  ctx_sw:    84   MEM     66.1%  active:     145M   SWAP     11.3%   LOAD    1-core
MEM  [|||||||||||||||||||||||||||||                66.1%]   user:     2.3%  irq:      0.0%  inter:    110   total:   490M  inactive:   248M   total:   4.00G   1 min:    0.04
SWAP [|||||                                        11.3%]   system:   1.0%  iowait:   0.0%  sw_int:   126   used:    324M  buffers:   12.2M   used:     464M   5 min:    0.02
                                                            idle:    96.8%  steal:    0.0%                  free:    166M  cached:     121M   free:    3.55G   15 min:   0.02
NETWORK     Rx/s   Tx/s   TASKS  81 (125 thr), 1 run, 80 slp, 0 oth sorted automatically by cpu_percent, flat view
eth0        768b    3Kb
lo          256b   256b     CPU%  MEM%  VIRT   RES   PID USER        NI S     TIME+   R/s   W/s Command 
                             3.2   5.6  519M 27.3M 14682 root         0 R   0:01.32     0     0 /usr/local/python/bin/python3.6 /usr/local/python/bin/glances
DISK I/O     R/s    W/s      0.0   0.1 18.9M  704K     1 root         0 S   0:06.78     0     0 /sbin/init
sda1           0      0      0.0   0.0     0     0     2 root         0 S   0:00.00     0     0 kthreadd
sda2           0    13K      0.0   0.0     0     0     3 root         0 S   0:00.00     0     0 migration/0
sda3           0      0      0.0   0.0     0     0     4 root         0 S   0:00.60     0     0 ksoftirqd/0
sda4           0      0      0.0   0.0     0     0     5 root         0 S   0:00.00     0     0 migration/0
                             0.0   0.0     0     0     6 root         0 S   0:00.20     0     0 watchdog/0
FILE SYS    Used  Total      0.0   0.0     0     0     7 root         0 S   0:05.17     0     0 events/0
/ (sda2)   4.11G   197G      0.0   0.0     0     0     8 root         0 S   0:00.00     0     0 cgroup
/boot      37.8M   484M      0.0   0.0     0     0     9 root         0 S   0:00.00     0     0 khelper
/usr       10.9G   291G      0.0   0.0     0     0    10 root         0 S   0:00.00     0     0 netns
                             0.0   0.0     0     0    11 root         0 S   0:00.00     0     0 async/mgr
                             0.0   0.0     0     0    12 root         0 S   0:00.00     0     0 pm
                             0.0   0.0     0     0    13 root         0 S   0:00.70     0     0 sync_supers
                             0.0   0.0     0     0    14 root         0 S   0:00.70     0     0 bdi-default
                             0.0   0.0     0     0    15 root         0 S   0:00.00     0     0 kintegrityd/0
                             0.0   0.0     0     0    16 root         0 S   0:01.43     0     0 kblockd/0
                             0.0   0.0     0     0    17 root         0 S   0:00.00     0     0 kacpid
                             0.0   0.0     0     0    18 root         0 S   0:00.00     0     0 kacpi_notify
                             0.0   0.0     0     0    19 root         0 S   0:00.00     0     0 kacpi_hotplug
                             0.0   0.0     0     0    20 root         0 S   0:00.00     0     0 ata_aux
                             0.0   0.0     0     0    21 root         0 S   0:00.00     0     0 ata_sff/0
                             0.0   0.0     0     0    22 root         0 S   0:00.00     0     0 ksuspend_usbd
2018-03-16 06:12:26       No warning or critical alert detected


以上是关于Linux性能监控工具:Glances部署实录的主要内容,如果未能解决你的问题,请参考以下文章

linux系统监控工具-glances

系统监控工具 Glances

linux下glances服务器监控工具

系统监控工具-glances

glances监控工具详解

glances监控工具详解