系统版本红帽 7.7:
- [[email protected] nmon_permon]# cat /etc/RedHat-release
- CentOS Linux release 7.7.1908 (Core)
- [[email protected] 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
- [[email protected] nmon_permon]#
nmon 下载地址预编译 tar:
先简单浏览一下支持情况: 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
- [[email protected] 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 越多:
来源: http://www.bubuko.com/infodetail-3377510.html