Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
> nmon is good for a spot check of activity on a system. Exactly! I use nmon for checking activity while my application is performing specific task, and because I do that quite frequently between 10 servers, it's confusing to have different order. –  shishkander May 2 '12 at 8:10
    
Indeed, you are right, /proc/diskstats is different between these two servers and correspond exactly to nmon's order. cat /proc/diskstats | grep sd | cut -c -17 on first server: 8 0 sda 8 1 sda1 8 2 sda2 8 5 sda5 8 32 sdc 8 33 sdc1 8 34 sdc2 8 16 sdb 8 17 sdb1 8 18 sdb2 on second: 8 32 sdc 8 33 sdc1 8 34 sdc2 8 37 sdc5 8 0 sda 8 1 sda1 8 2 sda2 8 16 sdb 8 17 sdb1 8 18 sdb2 –  shishkander May 2 '12 at 8:14
    
Can you post your df -h output? I think this is just a matter of the disk mount order from the boot process. –  ewwhite May 2 '12 at 8:28
    
I've put the output into question, as it was unreadable as a comment. –  shishkander May 2 '12 at 8:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.