4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Redhat on Power で nmon を使ってみました

Last updated at Posted at 2025-06-06

nmonってすこぶる便利ですよね。
元々IBMの内部プロジェクトで作られたもので、AIX環境で20年以上前から利用されてきています。
10年以上前には、AIXオペレーティングシステムに同梱されるようになりましたし、
Linux版もできて、今現在はLinux on Powerの他、x86、ARM、z/Linuxなど様々なアーキテクチャにも対応しています。

私自身はAIXで長年nmonを愛用していますが、Linux on Powerで使用したい機会があったので、その時のメモです。

RHEL バージョンの確認

今回は意図的に古めのRedHat Enterprise Linuxを使っています。

[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.8 (Maipo)

nmon のダウンロードと解凍

下記サイトから、nmonをダウンロードします。

ちなみに、2020年9月時点で100万ダウンロードを超えたらしいです。

Are these tools popular?
nmon, njmon and related tools hit 1 million downloads on 5th Sept 2020

今時点での最新版をダウンロードし、該当RHEL on Power上に転送しました。
とりあえず今回は、/tmp/nmonディレクトリを作成し配置しています。

[root@localhost nmon]# pwd
/tmp/nmon
[root@localhost nmon]# ls
nmon16p_32_binaries_feb_2024.tar.gz

ダウンロードしたnmonを解凍してみます。
Powerとx86_64の両方のアーキテクチャーで、対応OSバージョン毎のモジュールが、なんと計32個も含まれていました。

[root@localhost nmon]# tar -zxvf ./nmon16p_32_binaries_feb_2024.tar.gz
./
./nmon_power_64le_rhel9
./nmon_x86_64_ubuntu23
./nmon_power_64le_rhel8
./nmon_power_64le_sles12
./nmon_power_64le_sles15
./nmon_x86_32_ubuntu14
./nmon_x86_64_centos5
./nmon_x86_64_centos6
./nmon_x86_64_centos7
./nmon_x86_64_centos8
./nmon_x86_64_debian10
./nmon_x86_64_debian11
./nmon_x86_64_oel5
./nmon_x86_64_oel6
./nmon_x86_64_oel7
./nmon_x86_64_oel8
./nmon_x86_64_oel9
./nmon_x86_64_opensuse12
./nmon_x86_64_opensuse15
./nmon_x86_64_rhel5
./nmon_x86_64_rhel6
./nmon_x86_64_rhel7
./nmon_x86_64_rhel8
./nmon_x86_64_rhel9
./nmon_x86_64_rocky8
./nmon_x86_64_rocky9
./nmon_x86_64_sles12
./nmon_x86_64_sles15
./nmon_x86_64_ubuntu16
./nmon_x86_64_ubuntu18
./nmon_x86_64_ubuntu20
./nmon_x86_64_ubuntu22
[root@localhost nmon]#

よく見ると、ここで解凍されたnmonは、モジュールファイル名から察するに、Power版のRHELはRHEL8かRHEL9対応のようです。

ちゃんと動くかもしれないですが、一応、RHEL7対応のnmonをダウンロードし直すことにしました。
nmon16j.tar.gzです。

[root@localhost nmon]# ls
nmon16j.tar.gz  nmon16p_32_binaries_feb_2024.tar.gz

nmon16j.tar.gzを解凍してみました。
このバージョンだと、6モジュールだけが含まれていました。

[root@localhost nmon]# tar -zxvf./nmon16j.tar.gz
nmon_AMD64_ubuntu1804
nmon_power_rhel75
nmon_power_sles12
nmon_power_sles15
nmon_power_ubuntu1804
nmon_x86_rhel75

/tmp/nmonにPATHを通しておきます。
ちゃんとした環境なら、それなりの場所において、そこにパスを通すべきですが、今回はお試しなので良しとします。

[root@localhost nmon]# export PATH=$PATH:/tmp/nmon
[root@localhost nmon]# env $PATH
env: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/tmp/nmon:

コマンド長いのでシンボリックリンクを貼って、"nmon"コマンドで使えるようにします。

root@localhost nmon]# ls
nmon16j.tar.gz                       nmon_power_rhel75  nmon_power_ubuntu1804
nmon16p_32_binaries_feb_2024.tar.gz  nmon_power_sles12  nmon_x86_rhel75
nmon_AMD64_ubuntu1804                nmon_power_sles15
[root@localhost nmon]# ln -s nmon_power_rhel75 nmon
[root@localhost nmon]# ls -l
合計 8968
lrwxrwxrwx. 1 root root      17  6月  6 15:02 nmon -> nmon_power_rhel75
-rw-r--r--. 1 root root 1014491  6月  6 14:46 nmon16j.tar.gz
-rw-r--r--. 1 root root 5311838  6月  6 14:30 nmon16p_32_binaries_feb_2024.tar.gz
-rwx------. 1  210  201  497856  4月  7  2019 nmon_AMD64_ubuntu1804
-rwx------. 1  210  201  463112  4月  7  2019 nmon_power_rhel75
-rwx------. 1  210  201  466360  4月  7  2019 nmon_power_sles12
-rwx------. 1  210  201  461792  4月  7  2019 nmon_power_sles15
-rwx------. 1  210  201  546480  4月  7  2019 nmon_power_ubuntu1804
-rwx------. 1  210  201  408984  4月  7  2019 nmon_x86_rhel75
[root@localhost nmon]#

nmon:オンラインのリソース使用状況を見てみる

#nmon コマンドを起動します。

┌nmon─16j─────────────────────Hostname=localhost────Refresh= 2secs ───15:03.42─┐
│                                                                              │
│   ------------------------------                                             │
│    _ __  _ __ ___   ___  _ __    	 For help type H or ...                │
│   | '_ \| '_ ` _ \ / _ \| '_ \          nmon -?  - hint                      │
│   | | | | | | | | | (_) | | | |         nmon -h  - full details              │
│   |_| |_|_| |_| |_|\___/|_| |_|                                              │
│                                        To stop nmon type q to Quit           │
│   ------------------------------                                             │
│                                                                              │
│   NAME="Red Hat Enterprise Linux Server" VERSION="7.8 (Maipo)"               │
│   PowerVM POWER8 (architected), altivec supported CHRP IBM,9028-21B          │
│   PowerVM Entitlement=1.00   VirtualCPUs=1 LogicalCPUs=8                     │
│   PowerVM SMT=8 Capped=0                                                     │
│   Processor Clock=3000 MHz   Little Endian                                   │
│                                                                              │
│   Use these keys to toggle statistics on/off:                                │
│     c = CPU         l = CPU Long-term     - = Faster screen updates          │
│     C = " WideView  U = Utilisation       + = Slower screen updates          │
│     m = Memory      V = Virtual memory    j = File Systems                   │
│     d = Disks       n = Network           . = only busy disks/procs          │
│     r = Resource    N = NFS               h = more options                   │
│     k = Kernel      t = Top-processes     q = Quit                           │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

"h"を押してヘルプを見る限り、AIXのnmonとそれほど変わりないようですし、
一般的によく見る以下のものなどは揃っていそうです。

  • "c":CPU使用状況
  • "m":メモリ使用状況
  • "n":ネットワーク使用状況
  • "d":ディスク使用状況
  • "t":TOPプロセス情報
┌nmon─16j─────────────────────Hostname=localhost────Refresh= 2secs ───15:29.37─┐
│ HELP: Hit h to remove this Info   Hit q to Quit ─────────────────────────────│
│ Letters which toggle on/off statistics:                                      │
│ h = This help                         | r = Resources OS & Proc              │
│ c = CPU Util  C = wide view           | l = longer term CPU averages         │
│ m = Memory & Swap    L=Huge           | V = Virtual Memory                   │
│ n = Network                           | N = NFS                              │
│ d = Disk I/O Graphs  D=Stats          | o = Disks %Busy Map                  │
│ k = Kernel stats & loadavg            | j = Filesystem Usage J=reduced       │
│ M = MHz by thread & CPU               | p = if(PowerVM) LPAR details         │
│ t = TopProcess 1=Priority/Nice/State  | u = TopProc with command line        │
│     ReOrder by: 3=CPU 4=RAM 5=I/O     |     Hit u twice to update            │
│ g = User Defined Disk Groups          | G = with -g switches Disk graphs     │
│     [start nmon with -g <filename>]   |     to disk groups only              │
│                                       | b = black & white mode               │
│ Other Controls:                       |                                      │
│ + = double the screen refresh time    | 0 = reset peak marks (">") to zero   │
│ - = half   the screen refresh time    | space refresh screen now             │
│ . = Display only busy disks & CPU     | q = Quit                             │
│                                                                              │
│ (C) Copyright 2009 Nigel Griffiths    | See http://nmon.sourceforge.net      │
│ Colour:#0#  #1#  #2#  #3#  #4#  #5#  #6#  #7#  #8#  #9#  #10# #11# #12#      │
│──────────────────────────────────────────────────────────────────────────────│
│                                                                              │
└─────────Warning: Some Statistics may not shown───────────────────────────────┘

nmon: リソース使用状況データ の収集

ヘルプを見るとゴチャマンと出てきて、読む気を失ったので、
いつもAIXで使っているnmonの知識で実行してみました。
とりあえず、1秒間隔、10分間のデータをファイルに取得するコマンドを実行してみました。

[root@localhost nmon]# nmon -f -s 1 -c 600
[root@localhost nmon]# ls -ltr
合計 9016
-rwx------. 1  210  201  546480  4月  7  2019 nmon_power_ubuntu1804
-rwx------. 1  210  201  463112  4月  7  2019 nmon_power_rhel75
-rwx------. 1  210  201  461792  4月  7  2019 nmon_power_sles15
-rwx------. 1  210  201  466360  4月  7  2019 nmon_power_sles12
-rwx------. 1  210  201  408984  4月  7  2019 nmon_x86_rhel75
-rwx------. 1  210  201  497856  4月  7  2019 nmon_AMD64_ubuntu1804
-rw-r--r--. 1 root root 5311838  6月  6 14:30 nmon16p_32_binaries_feb_2024.tar.gz
-rw-r--r--. 1 root root 1014491  6月  6 14:46 nmon16j.tar.gz
lrwxrwxrwx. 1 root root      17  6月  6 15:02 nmon -> nmon_power_rhel75
-rw-r--r--. 1 root root   47818  6月  6 15:51 localhost_250606_1550.nmon
[root@localhost nmon]# fuser -u localhost_250606_1550.nmon
/tmp/nmon/localhost_250606_1550.nmon:  1586(root)
[root@localhost nmon]#

取得したnmonファイルをPCにダウンロードして、nmon Analyserでサクッとグラフ化できました。
nmon Analyser

負荷をほとんどかけなかったので、グラフとしてつまらないですが、
CPU以外も含めてあらゆるリソースの情報が丸っと取得されて、サクッとグラフ化できてました。
やっぱりnmonは優秀ですね。

ということで、
Linux on Power でも、いつも使っているAIXと同じ感じで nmon を使うことができました。

image.png

以上です。

4
2
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?