[转帖]How use Nmon and "Java Nmon Analyzer" for Monitor Linux Performance

Posted jinanxiaolaohu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[转帖]How use Nmon and "Java Nmon Analyzer" for Monitor Linux Performance相关的知识,希望对你有一定的参考价值。

How use Nmon and "Java Nmon Analyzer" for Monitor Linux Performance

https://linoxide.com/monitoring-2/install-nmon-monitor-linux-performance/

 

Nmon is a  resource monitoring tools which can monitor CPU, Memory, Disks, Network and even Filesystem on RHEL / Ubuntu systems. Java Nmon Analyzer is a tool that uses the nmon output as an input. It will graph the nmon output into an informative graph to make it easier to read. This article I will show you how to install and use nmon on linux.

What is nmon and Java Nmon Analyzer

Nmon is short for Nigel’s Performance Monitor. This tool is used to monitor resources on Linux, Power, x86, x86_64, Mainframe and ARM (Raspberry Pi). There is two mode available of nmon.

1. Online Mode, which used to real-time monitoring.
2. Capture Mode, which the output will saved to a CSV file for later processing.

Java Nmon Analyzer will use nmon output as an input data to be processed. So to use it, we will first need to have nmon installed and working on your system. Let’s start.

Features

Nmon is specializing to monitor and analyzing performance which includes :

  • CPU utilization
  • CPU Long-term
  • Memory usage
  • Virtual memory
  • Disks
  • Resource
  • Kernel
  • Filesystem
  • Network
  • NFS
  • Top-processes

Installing nmon

Nmon is available in binaries file or source code file for those who want to compile it by yourself. Binaries file is available on nmon download page while nmon source code is available in compiling nmon page. At this article is written, the latest version of nmon is 14g.

Method 1 : Using pre-compiled binaries file

  • Download nmon_linux_14i.tar.gz
  • Extract it
  • Go to the folder you extracted
  • Choose the appropriate binary file which match your system. For example, if you are using 32-bit version of Ubuntu 13, then you will found a binary file with name nmon_x86_ubuntu13
  • To run it, just type ./nmon_x86_ubuntu13

Method 2 : Compile nmon from the source

If you want to compile nmon by yourself, here’s the steps :

  • Download the source code file
  • Download the makefile
  • Rename the source code file to lmon.c . If you download lmon14g.c, then rename it.
  • Look at the makefile content and file the directive that matches your platform and Linux release
  • Make nmon. For example, if you are using Ubuntu 13.04, then you can type

$ make nmon_x86_ubuntu1304

  • Done. Next, you will find a binary file which name nmon_x86_ubuntu1304
  • Type ./nmon_x86_ubuntu1304 to run it

技术图片

Note :
If you found about no ncurses.h file, then you need to install ncurses-dev package.

技术图片

On Debian / Ubuntu based, you can install it using:

$ sudo apt-get install libncurses5-dev

How to Java Nmon Analyzer

Actually, we don’t install Java Nmon Analyzer. But we just run it with Java. This tool can be downloaded from Java Nmon Analyzer download page. After you finish download it, here are the steps how to run it.

  • Download and install nmon (make sure you have it)
  • Make a pipe for nmon

# mkfifo /tmp/nmonnamedpipe

  • Run analyzer agent in the target host :

# java -cp nmonanal_0.1.2.jar li.xiang.nmonanalyser.agent.Agent

The li.xiang.nmonanalyser.agent.Agent is a syntax. Don’t change it.
If it success, you will see a message below :

技术图片

  • 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.

If it success, you will see an IP Address connected. See below :

技术图片

  • Run Java Nmon Analyzer GUI

# java -jar nmonanal_0.1.2.jar

A pop-up window name System Performance Monitor for LINUX & AIX will show. Then you need to load the data.

  • Click Data Loader > From Agent. Then enter target IP Address and its port. By default, it will use 8187 port number

技术图片

  • Click OK
  • Wait for couple seconds and the GUI start showing you the result

技术图片

技术图片

技术图片

技术图片

You can also choose to display the output within the specific time range. The available time range are :

  • 1 minutes
  • 5 minutes
  • 10 minutes
  • 30 minutes
  • 1 hours
  • 2 hours
  • 3 hours
  • 6 hours
  • 12 hours
  • 1 day
  • 2 day

With Java Nmon Analyzer, we can graph nmon output to make it easier to read. This application also easy to use because we don’t need to install it and it has simple menus to understand.

以上是关于[转帖]How use Nmon and "Java Nmon Analyzer" for Monitor Linux Performance的主要内容,如果未能解决你的问题,请参考以下文章

How To Use Logstash and Kibana To Centralize Logs On CentOS 6

How to cross-compile and use Mainline Kernel

(转)How to Use Elasticsearch, Logstash, and Kibana to Manage MySQL Logs

How TCP clients and servers communicate using the TCP sockets interface

How Hulu Uses InfluxDB and Kafka to Scale to Over 1 Million Metrics a Second

How to Upload Long Text into SAP Using Excel Sheet and SAVE_TEXT Function Module