Linux nmon 服务器监控工具

1.简介

  nmon是一个部署在Linux服务器上的监控工具,可以监控CPU、内存、网络情况、磁盘IO、线程进程等

2.安装部署

根据自己的Linux操作系统来下载对应的rpm包

搜索地址: https://pkgs.org/search/?q=nmon

二进制包下载地址: https://download-ib01.fedoraproject.org/pub/epel/7/aarch64/Packages/n/nmon-16g-3.el7.aarch64.rpm

将包使用ftp工具上传到环境中

rpm -ivh nmon-16g-3.el7.aarch64.rpm

结果:

warning: nmon-16g-3.el7.aarch64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:nmon-16g-3.el7                   ################################# [100%]

查看是否安装成功:

whereis nmon
结果如下:
nmon: /usr/bin/nmon /usr/share/man/man1/nmon.1.gz

3.nmon使用

(1)实时分析

nmon

  

 ------------------------------                                           
    _ __  _ __ ___   ___  _ __         For help type H or ...                  
   | '_ \| '_ ` _ \ / _ \| '_ \          nmon -?  - hint
   | | | | | | | | | (_) | | | |         nmon -h  - full details
   |_| |_|_| |_| |_|\___/|_| |_|                                            
                                        To stop nmon type q to Quit         
   ------------------------------                                           
                                                                           
   CentOS Linux release 7.6.1810 (AltArch)  VERSION="7 (AltArch)"           
   Vendor=not-set Model=not-set                                             
   MHz=not-set bogomips=not-set           lscpu:CPU=96 Little Endian        
                                                Sockets=2 Cores=48 Thrds=1  
                    VirtualCPUs =96             MHz=0 max=2600 min=200      
                                                                    
   Use these keys to toggle statistics on/off:                              
     c = CPU         l = CPU Long-term     - = Faster screen updates        
     C = " WideView  U = Utilisation       + = Slower screen updates        
     m = Memory      V = Virtual memory    j = File Systems
     d = Disks       n = Network           . = only busy disks/procs
     r = Resource    N = NFS               h = more options
     k = Kernel      t = Top-processes     q = Quit

(2)非实时分析

nmon可以离线对数据进行收集,然后使用nmonchart、nmon_analyser工具将收集的数据进行绘图、展现。

nmon -s1 -c300 -f -m /opt/nmon/hive
-s1      :表示每隔n秒抽样一次
-c300    :表示采样次数
-f       :表示使用非交互模式
-m       :表示文件输出路径,目录必须提前创建 <hostname>_YYMMDD_HHMM.nmon
-t       :表示统计top进程信息

结果文件:server1_200731_1852.nmon

(3)使用nmonchart生成图形

nmon在生成数据之后,会生成一个*.nmon文件,可以使用nmonchart来生成html的服务器性能报表

具体操作流程:https://www.cnblogs.com/lijiaman/p/9466614.html

(4)使用nmon_analyser生成图形

nmon_analyser工具需要下载

下载地址:http://nmon.sourceforge.net/pmwiki.php?n=Site.Nmon-Analyser

打开文件:

nmon_analyser v66.xlsm

猜你喜欢

转载自blog.csdn.net/qq_35260875/article/details/109898225