Linux – How to specify specific disk order in nmon for linux

linuxmonitoring

I'm using nmon in interactive mode for monitoring disk activity on many servers, each with a several hard drives. The order in which nmon displays harddrives varies between different servers, and I want to have the same order on all servers.

Note that I'm using interactive mode (start nmon from command line, then press d).
I've tried using disk groups file (-g starting option) with exactly one disk per line, but it's output is not as easy read to read because it doesn't use the graphic representation of load the way d does.

Update

Apparently there is no other way than hacking into nmon because nmon uses the same order as /proc/diskparts, which can hardly be changed.

For example, this is output on one server:

┌nmon─12f─────────────────────Hostname=testhost001──Refresh= 1secs ───16:19.38────┐
│ Disk I/O ─────(/proc/diskstats)────────all data is Kbytes per second────────────│
│DiskName Busy  Read WriteKB|0          |25         |50          |75       100|   │
│sda        0%    0.0    0.0|               >                                 |   │
│sda1       0%    0.0    0.0|               >                                 |   │
│sda2       0%    0.0    0.0|>                                                |   │
│sda5       0%    0.0    0.0|    >                                            |   │
│sdc        0%    0.0    0.0| >                                               |   │
│sdc1       0%    0.0    0.0| >                                               |   │
│sdc2       0%    0.0    0.0|>                                                |   │
│sdb      100% 1226.4    0.0|RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR|>  │
│sdb1       0%    0.0    0.0|                                                 |   │
│sdb2     100% 1226.4    0.0|RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR|>  |

and this is on the other:

┌nmon─12f─────────────────────Hostname=testhost002──Refresh= 1secs ───16:19.38────┐
│ Disk I/O ─────(/proc/diskstats)────────all data is Kbytes per second────────────│
│DiskName Busy  Read WriteKB|0          |25         |50          |75       100|   │
│sdc        0%    0.0    0.0| >                                               |   │
│sdc1       0%    0.0    0.0| >                                               |   │
│sdc2       0%    0.0    0.0|>                                                |   │
│sda        0%    0.0    0.0|               >                                 |   │
│sda1       0%    0.0    0.0|               >                                 |   │
│sda2       0%    0.0    0.0|>                                                |   │
│sda5       0%    0.0    0.0|    >                                            |   │
│sdb      100% 1226.4    0.0|RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR|>  │
│sdb1       0%    0.0    0.0|                                                 |   │
│sdb2     100% 1226.4    0.0|RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR|>  |

and this is using disk groups, one hard drive per line:

┌nmon─12f─────────────────────Hostname=testhost002──Refresh= 1secs ───16:30.02────┐
│ Disk-Group-I/O ─────────────────────────────────────────────────────────────────│
│ Name          Disks AvgBusy Read|Write-KB/s  TotalMB/s   xfers/s BlockSizeKB    │
│ sda                1   0.0%       0.0|0.0          0.0       0.0    0.0         │
│ sdb                1   0.0%       0.0|0.0          0.0       0.0    0.0         │
│ sdc                1   0.0%       0.0|0.0          0.0       0.0    0.0         │

Update:
As has been suggested by ewwhite, the order of output is exactly same as /proc/diskstats. So, maybe it's easier to affect the order of diskstats instead, but that looks like an overkill.

df -h on
server 1:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             895G   30G  820G   4% /
none                  7.8G  212K  7.8G   1% /dev
none                  7.8G     0  7.8G   0% /dev/shm
none                  7.8G  104K  7.8G   1% /var/run
none                  7.8G     0  7.8G   0% /var/lock
none                  7.8G     0  7.8G   0% /lib/init/rw
/dev/sdb1             640G  298G  343G  47% /data_b1
/dev/sdb2             1.2T  510G  684G  43% /data_b2
/dev/sdc1             640G  148G  493G  24% /data_c1
/dev/sdc2             1.2T  361G  832G  31% /data_c2

on server 2:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc1             895G  257G  594G  31% /
none                  7.8G  212K  7.8G   1% /dev
none                  7.8G     0  7.8G   0% /dev/shm
none                  7.8G  116K  7.8G   1% /var/run
none                  7.8G     0  7.8G   0% /var/lock
none                  7.8G     0  7.8G   0% /lib/init/rw
/dev/sda1             640G  156G  485G  25% /data_b1
/dev/sda2             1.2T  511G  684G  43% /data_b2
/dev/sdb1             640G  148G  493G  24% /data_c1
/dev/sdb2             1.2T  362G  833G  31% /data_c2

Best Answer

nmon is good for a spot check of activity on a system. For watching multiple servers, would it make more sense to move to a more comprehensive monitoring system?

As far as the order of the disk entries displayed on the system, it seems to be tied to /proc/diskstats and the mount order from boot. I just checked 10 of my servers running nmon and I received the same order of devices.

What does cat /proc/diskstats | grep sd look like on both systems? Can you show the output of df -h or fdisk -l from your two servers?

Edit:
In this case, it looks like your device ordering is the root case. /dev/sdc is your boot volume on one of the servers (instead of sda), so it appears first in the device order. I don't believe there's a quick way to modify this for the purposes of displaying data in nmon.

Related Topic