Solaris 11 系统信息查看

3340阅读 0评论2016-12-17 tolilong
分类:SOLARIS

1 查看硬盘大小

可以使用format命令,或者iostat -En命令

也可以通过下面的ksh脚本来查询。

对于x86:

  1. #!/bin/ksh
  2. for disk in /dev/rdsk/*p0
  3. do
  4.   fdisk -G $disk | tail -1 | nawk '{
  5.     disk="'$disk'"
  6.     ncyl=$2
  7.     nhead=$5
  8.     nsect=$6
  9.     secsz=$7
  10.     sectors=ncyl*nhead*nsect;
  11.     bytes=sectors/(1024/secsz);
  12.     printf("%7d MB %s %11d sectorsn",
  13.       bytes/1024, disk, sectors);
  14.   }'
  15. done 2>/dev/null

对于sparc:

  1. #!/bin/ksh
  2. for disk in /dev/rdsk/*s2
  3. do
  4.   fdisk -g $disk | tail -1 | nawk '{
  5.     disk="'$disk'"
  6.     ncyl=$2
  7.     nhead=$5
  8.     nsect=$6
  9.     secsz=$7
  10.     sectors=ncyl*nhead*nsect;
  11.     bytes=sectors/(1024/secsz);
  12.     printf("%7d MB %s %11d sectorsn",
  13.       bytes/1024, disk, sectors);
  14.   }'
  15. done 2>/dev/null

2 查看系统信息

prtdiag -v

点击(此处)折叠或打开

  1. # prtdiag -v
  2. System Configuration: Oracle Corporation sun4v SPARC T4-1
  3. Memory size: 128 Gigabytes

  4. ================================ Virtual CPUs ================================


  5. CPU ID Frequency Implementation Status
  6. ------ --------- ---------------------- -------
  7. 0 2848 MHz SPARC-T4 on-line
  8. 1 2848 MHz SPARC-T4 on-line
  9. 2 2848 MHz SPARC-T4 on-line
  10. 3 2848 MHz SPARC-T4 on-line
  11. 4 2848 MHz SPARC-T4 on-line
  12. ...
  13. 61 2848 MHz SPARC-T4 on-line
  14. 62 2848 MHz SPARC-T4 on-line
  15. 63 2848 MHz SPARC-T4 on-line

  16. ======================= Physical Memory Configuration ========================
  17. Segment Table:
  18. --------------------------------------------------------------
  19. Base Segment Interleave Bank Contains
  20. Address Size Factor Size Modules
  21. --------------------------------------------------------------
  22. 0x0 128 GB 2 64 GB /SYS/MB/CMP0/BOB0/CH1/D0
  23.                                               /SYS/MB/CMP0/BOB1/CH1/D0
  24.                                      64 GB /SYS/MB/CMP0/BOB2/CH1/D0
  25.                                               /SYS/MB/CMP0/BOB3/CH1/D0


  26. ================================= IO Devices =================================
  27. Slot + Bus Name + Model Speed
  28. Status Type Path
  29. ------------------------------------------------------------------------------
  30. /SYS/MB/SASHBA0 PCIE scsi-pciex1000,72 LSI,2008 5.0GTx8
  31.                         /pci@400/pci@1/pci@0/pci@4/scsi@0
  32. /SYS/MB/RISER0/PCIE0 PCIE SUNW,qlc-pciex1077,2532 QLE2562 5.0GTx4
  33.                         /pci@400/pci@1/pci@0/pci@8/SUNW,qlc@0
  34. /SYS/MB/RISER0/PCIE0 PCIE SUNW,qlc-pciex1077,2532 QLE2562 5.0GTx4
  35.                         /pci@400/pci@1/pci@0/pci@8/SUNW,qlc@0,1
  36. /SYS/MB/SASHBA1 PCIE scsi-pciex1000,72 LSI,2008 5.0GTx8
  37.                         /pci@400/pci@2/pci@0/pci@4/scsi@0
  38. /SYS/MB/NET0 PCIE network-pciex8086,10c9 2.5GTx4
  39.                         /pci@400/pci@2/pci@0/pci@6/network@0
  40. /SYS/MB/NET1 PCIE network-pciex8086,10c9 2.5GTx4
  41.                         /pci@400/pci@2/pci@0/pci@6/network@0,1
  42. /SYS/MB/NET2 PCIE network-pciex8086,10c9 2.5GTx4
  43.                         /pci@400/pci@2/pci@0/pci@7/network@0
  44. /SYS/MB/NET3 PCIE network-pciex8086,10c9 2.5GTx4
  45.                         /pci@400/pci@2/pci@0/pci@7/network@0,1
  46. /SYS/MB/RISER1/PCIE1 PCIE network-pciex8086,10fb X1109a-z/1109a-z 5.0GTx8
  47.                         /pci@400/pci@2/pci@0/pci@8/network@0
  48. /SYS/MB/RISER1/PCIE1 PCIE network-pciex8086,10fb X1109a-z/1109a-z 5.0GTx8
  49.                         /pci@400/pci@2/pci@0/pci@8/network@0,1
  50. /SYS/MB/VIDEO PCIX display-pci1a03,2000 --
  51.                         /pci@400/pci@2/pci@0/pci@0/pci@0/display@0
  52. /SYS/MB/PCIE-IO/USB PCIX usb-pciclass,0c0310 --
  53.                         /pci@400/pci@2/pci@0/pci@f/pci@0/usb@0
  54. /SYS/MB/PCIE-IO/USB PCIX usb-pciclass,0c0310 --
  55.                         /pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,1
  56. /SYS/MB/PCIE-IO/USB PCIX usb-pciclass,0c0320 --
  57.                         /pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2

  58. ============================ Environmental Status ============================
  59. Fan sensors:
  60. ----------------------------------------------------------------
  61. Location Sensor Status
  62. ----------------------------------------------------------------
  63. SYS/FANBD/FM0/F0 TACH ok
  64. SYS/FANBD/FM0/F1 TACH ok
  65. SYS/FANBD/FM1/F0 TACH ok
  66. ...

3 查看CPU信息

可以使用这个命令
psrinfo -pv

或者,更强大的下面这个脚本:
  1. % cat showcpucount

  2. --------------------------------------- CUT HERE -------------------------------------------
  3. #!/bin/bash

  4. /usr/bin/kstat -m cpu_info | egrep "chip_id|core_id|module: cpu_info" > /var/tmp/cpu_info.log

  5. nproc=`(grep chip_id /var/tmp/cpu_info.log | awk '{ print $2 }' | sort -u | wc -l | tr -d ' ')`
  6. ncore=`(grep core_id /var/tmp/cpu_info.log | awk '{ print $2 }' | sort -u | wc -l | tr -d ' ')`
  7. vproc=`(grep 'module: cpu_info' /var/tmp/cpu_info.log | awk '{ print $4 }' | sort -u | wc -l | tr -d ' ')`

  8. nstrandspercore=$(($vproc/$ncore))
  9. ncoresperproc=$(($ncore/$nproc))

  10. speedinmhz=`(/usr/bin/kstat -m cpu_info | grep clock_MHz | awk '{ print $2 }' | sort -u)`
  11. speedinghz=`echo "scale=2; $speedinmhz/1000" | bc`

  12. echo "Total number of physical processors: $nproc"
  13. echo "Number of virtual processors: $vproc"
  14. echo "Total number of cores: $ncore"
  15. echo "Number of cores per physical processor: $ncoresperproc"
  16. echo "Number of hardware threads (strands or vCPUs) per core: $nstrandspercore"
  17. echo "Processor speed: $speedinmhz MHz ($speedinghz GHz)"

  18. # now derive the vcpu-to-core mapping based on above information #

  19. echo -e "\n** Socket-Core-vCPU mapping **"
  20. let linenum=2

  21. for ((i = 1; i <= ${nproc}; ++i ))
  22. do
  23.         chipid=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $2 }'`
  24.         echo -e "\nPhysical Processor $i (chip id: $chipid):"

  25.         for ((j = 1; j <= ${ncoresperproc}; ++j ))
  26.         do
  27.                 let linenum=($linenum + 1)
  28.                 coreid=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $2 }'`
  29.                 echo -e "\tCore $j (core id: $coreid):"

  30.                 let linenum=($linenum - 2)
  31.                 vcpustart=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $4 }'`

  32.                 let linenum=(3 * $nstrandspercore + $linenum - 3)
  33.                 vcpuend=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $4 }'`

  34.                 echo -e "\t\tvCPU ids: $vcpustart - $vcpuend"
  35.                 let linenum=($linenum + 4)
  36.         done
  37. done

  38. rm /var/tmp/cpu_info.log
  39. --------------------------------------- CUT HERE -------------------------------------------

  40. # prtdiag | head -1
  41. System Configuration: Sun Microsystems sun4u SPARC Enterprise M4000 Server

  42. # ./showcpucount
  43. Total number of physical processors: 4
  44. Number of virtual processors: 32
  45. Total number of cores: 16
  46. Number of cores per physical processor: 4
  47. Number of hardware threads (strands or vCPUs) per core: 2
  48. Processor speed: 2660 MHz (2.66 GHz)

  49. ** Socket-Core-vCPU mapping **

  50. Physical Processor 1 (chip id: 1024):
  51.         Core 1 (core id: 0):
  52.                 vCPU ids: 0 - 1
  53.         Core 2 (core id: 2):
  54.                 vCPU ids: 2 - 3
  55.         Core 3 (core id: 4):
  56.                 vCPU ids: 4 - 5
  57.         Core 4 (core id: 6):
  58.                 vCPU ids: 6 - 7

  59. Physical Processor 2 (chip id: 1032):
  60.         Core 1 (core id: 8):
  61.                 vCPU ids: 8 - 9
  62.         Core 2 (core id: 10):
  63.                 vCPU ids: 10 - 11
  64.         Core 3 (core id: 12):
  65.                 vCPU ids: 12 - 13
  66.         Core 4 (core id: 14):
  67.                 vCPU ids: 14 - 15

  68. Physical Processor 3 (chip id: 1040):
  69.         Core 1 (core id: 16):
  70.                 vCPU ids: 16 - 17
  71.         Core 2 (core id: 18):
  72.                 vCPU ids: 18 - 19
  73.         Core 3 (core id: 20):
  74.                 vCPU ids: 20 - 21
  75.         Core 4 (core id: 22):
  76.                 vCPU ids: 22 - 23

  77. Physical Processor 4 (chip id: 1048):
  78.         Core 1 (core id: 24):
  79.                 vCPU ids: 24 - 25
  80.         Core 2 (core id: 26):
  81.                 vCPU ids: 26 - 27
  82.         Core 3 (core id: 28):
  83.                 vCPU ids: 28 - 29
  84.         Core 4 (core id: 30):
  85.                 vCPU ids: 30 - 31


另外,还有下面的一些命令
Command
System Information Displayed
Man Page
/usr/X11/bin/scanpci
查看PCIe的详细信息

hostid
Host ID number
isainfo
The number of bits supported by native applications on the running system, which can be passed as a token to scripts
isalist
Processor type for x86 based systems
prtconf
System configuration information, installed memory, device properties, and product name
psrinfo
Processor type
uname
Operating system name, release, version, node name, hardware name, and processor type

上一篇:你看他牛,因为他比你努力
下一篇:没有了