zoukankan      html  css  js  c++  java
  • nmon+Java Nmon Analyser进行nmon监控数据可视化分析

    我们知道nmon是一款轻量级的系统占用极少,监控功能非常强大支持跨平台ARM,centos,ubuntu等等系统的工具下载地:centos7 

    wget http://sourceforge.net/projects/nmon/files/nmon16e_mpginc.tar.gz

    在sourceforge我们可以找到一个基于java编写的解析nmon监控出来的.nmon格式数据解析成报告jar包;

    sourceforge地址:https://sourceforge.net/projects/jnmonanalyser/files/

    由于nmon本身自带的也有Nmon Analyser,这里我不在介绍,看个人喜好,以及实际监控数据的文件结果大小,选取合适解析工具;

    下面我们一起使用这个Java Nmon Analyser:

     下载下来后是一个简单的jar包以及它的开发者的一个简单的readme.txt:

    User's  guide
    ----------------
    1. Download and install nmon.
     - for linux platform, you can download form: http://nmon.sourceforge.net.
     - For AIX platform, you can download form : http://www.ibm.com/developerworks/wikis/display/WikiPtype/nmon , AIX 5.3 TL09+ and AIX 6.1 TL02 include nmon function within topas and its installed by default.
    
    2. Make a pipe for nmon.
    #mkfifo /tmp/nmonnamedpipe 
    
    3. Run analyser's agent in target host:
    # java -cp nmonanal_0.1.2.jar li.xiang.nmonanalyser.agent.Agent
    
    4. Run nmon, begin performance capture.
     #nmon -s 20 -c 360 -F /tmp/nmonnamedpipe  
    20 second per snapshot, capture 360 snapshots, totally 2 hrs. you can put the command in crontab for long time data capture.
    
    5. Run java nmon analyser gui.
    # java -jar nmonanal_0.1.2.jar
    
    5.1 Get the real-time performance data from agent
    
    Main menu --> " Data Loader "  --> "from agent".  Input the target's ip address and port number(default is 8187).
    
    5.2 Get the performance data form nmon data collection file.
    
    Developer's guide.
    -------------------
    
    The interface NmonDataLoader load nmon data for analyzing, Interface NmonDataListener is observer of NmonDataLoader. It can  rgister in NmonDataLoader, NmonDataLoader callback  NmonDataListener, when NmonDataLoader read a nmon output line. NmonDataListener parser the nmon data and return the performance charts by getCharts().
    
    There 2 NmonDataLoader implement : NmonFileLoader and NmonAgentLoader , NmonFileLoader  load nmon data from nmon collection file. NmonAgentLoader load nmon data from agent. 
    
    There 3 NmonListener implement: CPUTagCharts, MEMTagCharts, PaginTagCharts, DiskTagCharts and NetworkCharts. 
    
    The sample load data from nmon file, and get the CPU cacategory performance charts : 
    
    
    NmonDataLoader loader = new NmonFileLoader("/tmp/nmonsampleoutput.nmon");
    CPUTagCharts  cpuCharts = new CPUTagCharts();
    loader.addDataObserver(cpuCharts);
    Thread loadThread = new Thread(loader);
    loadThread.start();
    JFreeChart[] charts = cpuCharts.getCharts();  
    

     使用也很简单直接双击jar包或者cmd执行java  -jar  nmonanal_0.1.3.jar  打开GUI界面选取你nmon监控生成的.nmon文件就可以了,此外它还可以支持agent模式见readme.txt,有详细介绍我就不再介绍了监控信息包含cpu,disk,NETWork,paging:

  • 相关阅读:
    SVN使用之分支、合并
    eq相等 ,ne、neq不相等 EL表达式
    PLSQL:plsql中文乱码,显示问号
    mysql中实现行号,oracle中的rowid
    安装完QQ必须要删除掉的几个恐怖文件
    关于table的一些兼容性问题
    Javascript事件绑定的几种方式
    jQuery中的一些正则匹配表达式
    将java类的泛型集合转换成json对象
    python登录豆瓣,发帖
  • 原文地址:https://www.cnblogs.com/SunshineKimi/p/12184689.html
Copyright © 2011-2022 走看看