linux nmon安装

系统版本红帽7.7:

[root@hostuser1 nmon_permon]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@hostuser1 nmon_permon]# uname -a
Linux hostuser1 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@hostuser1 nmon_permon]#

nmon下载地址预编译tar:http://nmon.sourceforge.net/pmwiki.php?n=Site.Download

先简单浏览一下支持情况:d,e,f版本不再支持,所以选取了g版本

 寻找适合自己的内核系统的红帽子tar包:

 这个tar包有: wget http://sourceforge.net/projects/nmon/files/nmon16g_x86.tar.gz

tar -zxvf  nmon16g_x86.tar.gz

里面解压出来有好几个系统的,rhel72就是红帽的7.2version

[root@hostuser1 nmon_permon]# ll
total 2460
-rw-------. 1 210 201 160664 Apr 20 2017 nmon16g_x86_fedora25
-rw-------. 1 210 201 406334 Apr 20 2017 nmon16g_x86_rhel72
-rw-------. 1 210 201 352321 Apr 20 2017 nmon16g_x86_sles114
-rw-------. 1 210 201 403944 Apr 20 2017 nmon16g_x86_sles12
-rw-r--r--. 1 root root 692079 Apr 20 2017 nmon16g_x86.tar.gz
-rw-------. 1 210 201 490840 Apr 20 2017 nmon16g_x86_ubuntu1604

这个需要赋权才可以执行,这里为了看的方便区分我改个名字:

mv nmon16g_x86_rhel72 nmon

chmod  a+x  nmon 

 环境变量 vi /etc/profile:

#nmon home
PATH=$PATH:/usr/local/nmon_permon
export PATH

source  /etc/profile 

验证nmon  -version 

nmon: invalid option -- 'v'
Hint for nmon version 16g
Full Help Info : nmon -h

On-screen Stats: nmon
Data Collection: nmon -f [-s <seconds>] [-c <count>] [-t|-T]
Capacity Plan : nmon -x
Interactive-Mode:
Read the Welcome screen & at any time type: "h" for more help
Type "q" to exit nmon

For Data-Collect-Mode
-f Must be the first option on the line (switches off interactive mode)
Saves data to a CSV Spreadsheet format .nmon file in then local directory
Note: -f sets a defaults -s300 -c288 which you can then modify
Further Data Collection Options:
-s <seconds> time between data snapshots
-c <count> of snapshots before exiting
-t Includes Top Processes stats (-T also collects command arguments)
-x Capacity Planning=15 min snapshots for 1 day. (nmon -ft -s 900 -c 96)
---- End of Hints

 进行监控:

 nmon -s 2 -c 4 -f -m ./ 

数据转csv :

sort hostuser1_200112_1454.nmon >  hostuser1_200112_1454.csv 

sz   hostuser1_200112_1454.csv 

下载nmon Analyzer:这里意思是文件地址已经转移到新的仓库维护,如果你这是想临时获取最新的直接下载那个提供的zip,历史版本请使用链接地址下提供的历史版本下载,我下的临时的

 可以带大家看看历史版本的Alasize.zip,这个老哥一看就是长得很有才华的那种程序猿 :

解压Alalize.zip使用分析器:这里需要启用visual 宏编辑功能提示会告诉你启用就可以了:

 数据解析:

 结果展示保存到新的excel,下面有很多sheet,挑选自己想要的就可以了,mem,cpu,disk,network等,注意这个是有单个cpu监控的,也就内核越多cousheet越多:

猜你喜欢

转载自www.cnblogs.com/SunshineKimi/p/12182736.html