Operating System - HP-UX
1825214 Members
4560 Online
109679 Solutions
New Discussion юеВ

retrieve disk serial number and CPU usage statistics

 
SOLVED
Go to solution
Michele Tomassi
Advisor

retrieve disk serial number and CPU usage statistics

Hello,
I need to retrieve through command line the following information about a HP-UX system rx7620 with HP 11iv2 operating system installed:
- the serial number of a disk device
- the CPU usage (I am looking for the same of "top" of Linux)

Thanks in advance for your support

Michele
14 REPLIES 14
Ludovic Derlyn
Esteemed Contributor

Re: retrieve disk serial number and CPU usage statistics

Hi,

for cpu usage , you can use sar -u ou sar -Mu if multi processors are present

for example

sar -Mu 2 10 (10 items every 2 seconds)


regards

L-DERLYN
Ludovic Derlyn
Esteemed Contributor
Solution

Re: retrieve disk serial number and CPU usage statistics

hi again

for serial number, use stm
the most easy , launch a x windows , export your display and launch stm on your server

Select disk and execute information log or view

Regards

L-DERLYN
Geoff Wild
Honored Contributor

Re: retrieve disk serial number and CPU usage statistics

Serial number of a disk?

You can get the product id:

# diskinfo /dev/rdsk/c28t5d0
SCSI describe of /dev/rdsk/c28t5d0:
vendor: HP 36.4G
product id: ST336752LC
type: direct access
size: 35566480 Kbytes
bytes per sector: 512


with top, you can show 1 screen:
top -d 1

Or use uptime for load...

Rgds...Geoff



Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Michele Tomassi
Advisor

Re: retrieve disk serial number and CPU usage statistics

Hi Ludovic,
thanks a lot for your answer
I tried sar -Mu (my system is multi processor), but it did not work, as you can see.

# sar -Mu
sar: Can't open /var/adm/sa/sa23

The sa folder was not present on /var/adm; I created it by hand and relaunched the command, but I obtained the same output as above. Any suggestion about it?

ON the contrary, through stm and cstm (I need a command that can be parsed) I successfully retrieved the information I need.
Thanks a lot for your support

Regards
Michele
Ludovic Derlyn
Esteemed Contributor

Re: retrieve disk serial number and CPU usage statistics

Hi Michele

For sar you must specify time intervals on numbers of items

for example

sar -Mu 2 10 (collect info every 2 s , 10 times)


16:46:43 cpu %usr %sys %wio %idle
16:46:45 0 0 0 0 100
1 5 3 12 81
system 3 1 6 90
16:46:47 0 2 0 0 99
1 12 4 84 0
system 7 2 42 49
16:46:49 0 42 13 0 44
1 4 2 93 0
system 23 8 47 22
16:46:51 0 9 2 0 88
1 5 3 93 0
system 7 3 47 44

regards

L-DERLYN
Sandman!
Honored Contributor

Re: retrieve disk serial number and CPU usage statistics

You need to provide the sampling interval for example if CPU usage is needed for the next 5 minutes you could collect data in 10 intervals of 30 seconds...

# sar -Mu 30 10
Michele Tomassi
Advisor

Re: retrieve disk serial number and CPU usage statistics

Hi Geoff,
thanks a lot for your answer; unfortunately I'm interested in the serial number of the disk.
I retrieved it through stm and cstm. Do you know if another way exist?
Just to clarify the environment, my server has 2 IBM disks attached through 4 Fibre Channels to a rx7620.These 2 IBM disks belong to a Storage Area Network

The strange situation I see is that each disk appears in 12 entries in the output of ioscan -fnC disk (3 entries for fibre channel path)
Why does it occur? I'm expecting that the disk appears only 1 time.

# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
disk 2 1/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c0t6d0 /dev/dsk/c0t6d0s2 /dev/rdsk/c0t6d0 /dev/rdsk/c0t6d0s2
/dev/dsk/c0t6d0s1 /dev/dsk/c0t6d0s3 /dev/rdsk/c0t6d0s1 /dev/rdsk/c0t6d0s3
disk 1 1/0/0/3/1.2.0 sdisk CLAIMED DEVICE _NEC DVD_RW ND-3550A
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 0 1/0/2/1/0.8.0 sdisk CLAIMED DEVICE HP 73.4GMAW3073NC
/dev/dsk/c4t8d0 /dev/rdsk/c4t8d0
disk 3 1/0/4/1/0.8.0 sdisk CLAIMED DEVICE HP 73.4GMAW3073NC
/dev/dsk/c6t8d0 /dev/rdsk/c6t8d0
disk 12 1/0/6/1/0/4/0.46.0.5.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c19t0d0 /dev/rdsk/c19t0d0
disk 28 1/0/6/1/0/4/0.46.0.5.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 14 1/0/6/1/0/4/0.46.0.10.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c21t0d0 /dev/rdsk/c21t0d0
disk 29 1/0/6/1/0/4/0.46.0.10.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 15 1/0/6/1/0/4/0.46.0.11.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c23t0d0 /dev/rdsk/c23t0d0
disk 30 1/0/6/1/0/4/0.46.0.11.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 16 1/0/10/1/0/4/0.61.0.4.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c25t0d0 /dev/rdsk/c25t0d0
disk 32 1/0/10/1/0/4/0.61.0.4.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 20 1/0/10/1/0/4/0.61.0.7.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c27t0d0 /dev/rdsk/c27t0d0
disk 33 1/0/10/1/0/4/0.61.0.7.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 21 1/0/10/1/0/4/0.61.0.11.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c29t0d0 /dev/rdsk/c29t0d0
disk 31 1/0/10/1/0/4/0.61.0.11.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 23 1/0/12/1/0/4/0.46.0.6.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c31t0d0 /dev/rdsk/c31t0d0
disk 34 1/0/12/1/0/4/0.46.0.6.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 25 1/0/12/1/0/4/0.46.0.9.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c33t0d0 /dev/rdsk/c33t0d0
disk 36 1/0/12/1/0/4/0.46.0.9.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 27 1/0/12/1/0/4/0.46.0.12.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c35t0d0 /dev/rdsk/c35t0d0
disk 35 1/0/12/1/0/4/0.46.0.12.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 5 1/0/14/1/0/4/0.61.0.1.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c13t0d0 /dev/rdsk/c13t0d0
disk 37 1/0/14/1/0/4/0.61.0.1.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 6 1/0/14/1/0/4/0.61.0.8.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c15t0d0 /dev/rdsk/c15t0d0
disk 38 1/0/14/1/0/4/0.61.0.8.100.0.0 sdisk CLAIMED DEVICE IBM 2107900
disk 9 1/0/14/1/0/4/0.61.0.10.98.0.0 sdisk CLAIMED DEVICE IBM 2107900
/dev/dsk/c17t0d0 /dev/rdsk/c17t0d0
disk 39 1/0/14/1/0/4/0.61.0.10.100.0.0 sdisk CLAIMED DEVICE IBM 2107900

I checked that a IBM disk x spans over the fibre channels and it is identified by the same BUS number (98 or 100, but would be possible to have a command that lists all disks (internal and external), but with only 1 entry for each disk?

Thanks a lot in advance for your support

Best regards

Michele
Michele Tomassi
Advisor

Re: retrieve disk serial number and CPU usage statistics

Hi Ludovic, Hi Sandman
I launched sar with the sample and time intervals parameter and it works.
Some hours ago I forgot the number of samples and time intervals parameters

Thanks a lot for your precious support

Michele
Sandman!
Honored Contributor

Re: retrieve disk serial number and CPU usage statistics

>The strange situation I see is that each disk appears in 12 entries in the
>output of ioscan -fnC disk (3 entries for fibre channel path)
>Why does it occur? I'm expecting that the disk appears only 1 time.

Imho that would depend on how many HBAs are installed in your server and the number of ports aka RAID controllers that the server is connected to on the storage array side? From the ioscan listing it seems like there are 4 HBAs. It would help if you could post the output of the following commands in order to get a better grasp of the system.

# ioscan -funC fc
# ioscan -funC fcp
# ioscan -funC ext_bus

The only other way I can think of getting the serial number of a dsk device would be thru software utils provided by the storage array vendor. For ex. the XP disk arrays subsystems come with a software tool called xpinfo which reports the serial number of a disk device inside the XP array.

~hope it helps
Michele Tomassi
Advisor

Re: retrieve disk serial number and CPU usage statistics

Hi Sandman,
thanks a lot for your answer.

For your information,the machine has 4 HBAs.
The server is connected to 2 switches; each connection with a switch is performed through 2 ports.
I launched the command you suggested and I'm posting their output:

#oscan -funC fc
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
fc 0 1/0/6/1/0/4/0 fcd CLAIMED INTERFACE HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
/dev/fcd0
fc 1 1/0/10/1/0/4/0 fcd CLAIMED INTERFACE HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
/dev/fcd1
fc 2 1/0/12/1/0/4/0 fcd CLAIMED INTERFACE HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
/dev/fcd2
fc 3 1/0/14/1/0/4/0 fcd CLAIMED INTERFACE HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
/dev/fcd3


# ioscan -funC fcp
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
fcp 0 1/0/6/1/0/4/0.46 fcd_fcp CLAIMED INTERFACE FCP Domain
fcp 1 1/0/10/1/0/4/0.61 fcd_fcp CLAIMED INTERFACE FCP Domain
fcp 2 1/0/12/1/0/4/0.46 fcd_fcp CLAIMED INTERFACE FCP Domain
fcp 3 1/0/14/1/0/4/0.61 fcd_fcp CLAIMED INTERFACE FCP Domain



# ioscan -funC ext_bus
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
ext_bus 0 1/0/0/3/0 c8xx CLAIMED INTERFACE SCSI C1010 Ultra160 Wide LVD A6793-60001
ext_bus 1 1/0/0/3/1 c8xx CLAIMED INTERFACE SCSI C1010 Ultra Wide Single-Ended A6793-60001
ext_bus 2 1/0/1/1/0/1/0 c8xx CLAIMED INTERFACE SCSI C1010 Ultra160 Wide LVD
ext_bus 3 1/0/1/1/0/1/1 c8xx CLAIMED INTERFACE SCSI C1010 Ultra160 Wide LVD
ext_bus 4 1/0/2/1/0 mpt CLAIMED INTERFACE SCSI Ultra320 A6961-60011
/dev/mpt4
ext_bus 5 1/0/2/1/1 mpt CLAIMED INTERFACE SCSI Ultra320 A6961-60011
/dev/mpt5
ext_bus 6 1/0/4/1/0 mpt CLAIMED INTERFACE SCSI Ultra320 A6961-60011
/dev/mpt6
ext_bus 7 1/0/4/1/1 mpt CLAIMED INTERFACE SCSI Ultra320 A6961-60011
/dev/mpt7
ext_bus 18 1/0/6/1/0/4/0.46.0.5.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 19 1/0/6/1/0/4/0.46.0.5.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 36 1/0/6/1/0/4/0.46.0.5.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 20 1/0/6/1/0/4/0.46.0.10.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 21 1/0/6/1/0/4/0.46.0.10.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 37 1/0/6/1/0/4/0.46.0.10.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 22 1/0/6/1/0/4/0.46.0.11.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 23 1/0/6/1/0/4/0.46.0.11.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 38 1/0/6/1/0/4/0.46.0.11.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 8 1/0/6/1/0/4/0.46.0.255.0 fcd_vbus CLAIMED INTERFACE FCP Device Interface
ext_bus 24 1/0/10/1/0/4/0.61.0.4.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 25 1/0/10/1/0/4/0.61.0.4.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 39 1/0/10/1/0/4/0.61.0.4.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 26 1/0/10/1/0/4/0.61.0.7.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 27 1/0/10/1/0/4/0.61.0.7.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 40 1/0/10/1/0/4/0.61.0.7.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 28 1/0/10/1/0/4/0.61.0.11.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 29 1/0/10/1/0/4/0.61.0.11.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 41 1/0/10/1/0/4/0.61.0.11.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 9 1/0/10/1/0/4/0.61.0.255.0 fcd_vbus CLAIMED INTERFACE FCP Device Interface
ext_bus 30 1/0/12/1/0/4/0.46.0.6.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 31 1/0/12/1/0/4/0.46.0.6.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 42 1/0/12/1/0/4/0.46.0.6.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 32 1/0/12/1/0/4/0.46.0.9.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 33 1/0/12/1/0/4/0.46.0.9.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 43 1/0/12/1/0/4/0.46.0.9.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 34 1/0/12/1/0/4/0.46.0.12.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 35 1/0/12/1/0/4/0.46.0.12.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 44 1/0/12/1/0/4/0.46.0.12.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 10 1/0/12/1/0/4/0.46.0.255.0 fcd_vbus CLAIMED INTERFACE FCP Device Interface
ext_bus 12 1/0/14/1/0/4/0.61.0.1.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 13 1/0/14/1/0/4/0.61.0.1.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 45 1/0/14/1/0/4/0.61.0.1.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 14 1/0/14/1/0/4/0.61.0.8.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 15 1/0/14/1/0/4/0.61.0.8.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 46 1/0/14/1/0/4/0.61.0.8.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 16 1/0/14/1/0/4/0.61.0.10.96 fcd_vbus NO_HW INTERFACE FCP Array Interface
ext_bus 17 1/0/14/1/0/4/0.61.0.10.98 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 47 1/0/14/1/0/4/0.61.0.10.100 fcd_vbus CLAIMED INTERFACE FCP Array Interface
ext_bus 11 1/0/14/1/0/4/0.61.0.255.0 fcd_vbus CLAIMED INTERFACE FCP Device Interface
#


In the last output, the Hw paths with NO_HW correspond to a disk removed during some tests. We removed with rmsf the HW paths for the disks, but with this command I am aware that situation is not clean. Is there anything else to be removed?

Thanks in advance for your support

Best regards
Michele
Ludovic Derlyn
Esteemed Contributor

Re: retrieve disk serial number and CPU usage statistics

Hi Michele

Disks in status "no hardware" will be deleted at next boot.
If disks are plugged now, it's possible that I will be visible with others address.

Regards

L-DERLYN

David Dilly
Regular Advisor

Re: retrieve disk serial number and CPU usage statistics

You can try :
rmsf -H 1/0/14/1/0/4/0.61.0.8.96 , to cleanup the NO_HW path.
Bye
Michele Tomassi
Advisor

Re: retrieve disk serial number and CPU usage statistics

Hi, rmsf -H is ok for me! I tried and it works!

Thanks a lot
Michele
Michele Tomassi
Advisor

Re: retrieve disk serial number and CPU usage statistics

I tried rsmf -H and it is ok with my requirements.

Thanks a lot
Michele