<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[CentOS 6 下安装和使用Nmon工具]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[Linux技术]]></category>
<pubDate>Fri, 24 Apr 2015 04:44:36 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	Nmon 工具是 IBM 提供的免费的在AIX与各种Linux操作系统上广泛使用的监控与分析工具。该工具可将服务器的系统资源耗用情况收集起来并输出一个特定的文件,并可利用 excel 分析工具nmonanalyser进行数据的统计分析。并且，nmon运行不会占用过多的系统资源，通常情况下CPU利用率不会超过2%。针对不同的操作系统版本，nmon有相应版本的程序。<br/><br/>下载安装：<br/>官方相关页面：https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Power%20Systems/page/nmon<br/>下载地址：http://nmon.sourceforge.net/pmwiki.php<br/>打开页面之后根据自己的实际情况，选择支持自己操作系统的版本，本文的测试机是CentOS 6 所以这里我们下载的是for CentOS 6 X86_64位的版本，下载地址是：<br/>http://sourceforge.net/projects/nmon/files/nmon_x86_64_centos6/download<br/><br/>下载后的文件名是：nmon_x86_64_centos6，为了方便使用我们把它改为nmon，赋予它执行权限，chmod +x nmon，nmon工具使用比较简单，在nmon目录执行./nmon就可以启动nmon了<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=168" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=168" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>输入“c”可显示CPU的信息，“m”对应内存、“n”对应网络，“d”可以查看磁盘信息，“j”可以查看文件系统，工具界面有使用提示，你可以使用./nmon -help查看详细的帮助信息。<br/><br/>测试采集数据：<br/>./nmon -f -t -r Test1 -s30 -c10<br/><br/>Test1 ：标题<br/>-f ：按标准格式输出文件名称：<hostname>_YYYYMMDD_HHMM.nmon<br/>-t ：输出最耗资源的进程<br/>-s ：每隔n秒抽样一次，这里为30秒<br/>-c ：取出多少个抽样数量，这里为10，即监控=10*30/60=5分钟<br/><br/>命令启动后，会在nmon所在目录下生成数据文件，并持续写入采集的数据，直至监控时间完成，这些操作都是自动完成，不用人工干预，如果你监控的时间比较长，你就可以继续做其他的事情了，如果想停止监控，需要查找nmon的进程号，然后kill掉进程就停止监控了。<br/><br/>执行完毕后，nmon目录下生成了一个 localhost_150424_1043.nmon 文件，我们要通过命令把它专程一个csv文件，sort localhost_150424_1043.nmon > test1.csv<br/>将test1.csv下载到本地之后，我们需要使用 nmon analyser工具来转换为excel文件。<br/><br/>nmon analyser下载地址：https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Power%20Systems/page/nmon_analyser<br/>当前最新版为4.2，文件很小，就200多K，下载后解压会有一个nmon analyser v42.xlsm文件，我们双击打开这个文件，在左上角的地方会有一个安全警告，提示宏已被禁用，这里使用的offices 2007，其他版本不清楚是否一样，<br/>点击旁边的选项，选择启用此内容，点击确定，<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=169" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=169" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>然后点击Analyser nmon data 按钮，选择下载下来的test1.csv文件，然后就会转换成.excel文件了。<br/><a href="http://www.zhanghaijun.com/attachment.php?fid=170" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=170" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.zhanghaijun.com/attachment.php?fid=171" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=171" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.zhanghaijun.com/attachment.php?fid=172" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=172" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.zhanghaijun.com/attachment.php?fid=173" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=173" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.zhanghaijun.com/attachment.php?fid=174" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=174" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><a href="http://www.zhanghaijun.com/attachment.php?fid=175" target="_blank"><img src="http://www.zhanghaijun.com/attachment.php?fid=175" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>感兴趣的朋友可以试试。<br/>Tags - <a href="http://www.zhanghaijun.com/tags/linux/" rel="tag">linux</a> , <a href="http://www.zhanghaijun.com/tags/nmon/" rel="tag">nmon</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] CentOS 6 下安装和使用Nmon工具]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>