1 查看硬盘大小
可以使用format命令,或者iostat -En命令也可以通过下面的ksh脚本来查询。
对于x86:
-
#!/bin/ksh
-
for disk in /dev/rdsk/*p0
-
do
-
fdisk -G $disk | tail -1 | nawk '{
-
disk="'$disk'"
-
ncyl=$2
-
nhead=$5
-
nsect=$6
-
secsz=$7
-
sectors=ncyl*nhead*nsect;
-
bytes=sectors/(1024/secsz);
-
printf("%7d MB %s %11d sectorsn",
-
bytes/1024, disk, sectors);
-
}'
- done 2>/dev/null
对于sparc:
-
#!/bin/ksh
-
for disk in /dev/rdsk/*s2
-
do
-
fdisk -g $disk | tail -1 | nawk '{
-
disk="'$disk'"
-
ncyl=$2
-
nhead=$5
-
nsect=$6
-
secsz=$7
-
sectors=ncyl*nhead*nsect;
-
bytes=sectors/(1024/secsz);
-
printf("%7d MB %s %11d sectorsn",
-
bytes/1024, disk, sectors);
-
}'
- done 2>/dev/null
2 查看系统信息
prtdiag -v点击(此处)折叠或打开
-
# prtdiag -v
-
System Configuration: Oracle Corporation sun4v SPARC T4-1
-
Memory size: 128 Gigabytes
-
-
================================ Virtual CPUs ================================
-
-
-
CPU ID Frequency Implementation Status
-
------ --------- ---------------------- -------
-
0 2848 MHz SPARC-T4 on-line
-
1 2848 MHz SPARC-T4 on-line
-
2 2848 MHz SPARC-T4 on-line
-
3 2848 MHz SPARC-T4 on-line
-
4 2848 MHz SPARC-T4 on-line
- ...
-
61 2848 MHz SPARC-T4 on-line
-
62 2848 MHz SPARC-T4 on-line
-
63 2848 MHz SPARC-T4 on-line
-
-
======================= Physical Memory Configuration ========================
-
Segment Table:
-
--------------------------------------------------------------
-
Base Segment Interleave Bank Contains
-
Address Size Factor Size Modules
-
--------------------------------------------------------------
-
0x0 128 GB 2 64 GB /SYS/MB/CMP0/BOB0/CH1/D0
-
/SYS/MB/CMP0/BOB1/CH1/D0
-
64 GB /SYS/MB/CMP0/BOB2/CH1/D0
-
/SYS/MB/CMP0/BOB3/CH1/D0
-
-
-
================================= IO Devices =================================
-
Slot + Bus Name + Model Speed
-
Status Type Path
-
------------------------------------------------------------------------------
-
/SYS/MB/SASHBA0 PCIE scsi-pciex1000,72 LSI,2008 5.0GTx8
-
/pci@400/pci@1/pci@0/pci@4/scsi@0
-
/SYS/MB/RISER0/PCIE0 PCIE SUNW,qlc-pciex1077,2532 QLE2562 5.0GTx4
-
/pci@400/pci@1/pci@0/pci@8/SUNW,qlc@0
-
/SYS/MB/RISER0/PCIE0 PCIE SUNW,qlc-pciex1077,2532 QLE2562 5.0GTx4
-
/pci@400/pci@1/pci@0/pci@8/SUNW,qlc@0,1
-
/SYS/MB/SASHBA1 PCIE scsi-pciex1000,72 LSI,2008 5.0GTx8
-
/pci@400/pci@2/pci@0/pci@4/scsi@0
-
/SYS/MB/NET0 PCIE network-pciex8086,10c9 2.5GTx4
-
/pci@400/pci@2/pci@0/pci@6/network@0
-
/SYS/MB/NET1 PCIE network-pciex8086,10c9 2.5GTx4
-
/pci@400/pci@2/pci@0/pci@6/network@0,1
-
/SYS/MB/NET2 PCIE network-pciex8086,10c9 2.5GTx4
-
/pci@400/pci@2/pci@0/pci@7/network@0
-
/SYS/MB/NET3 PCIE network-pciex8086,10c9 2.5GTx4
-
/pci@400/pci@2/pci@0/pci@7/network@0,1
-
/SYS/MB/RISER1/PCIE1 PCIE network-pciex8086,10fb X1109a-z/1109a-z 5.0GTx8
-
/pci@400/pci@2/pci@0/pci@8/network@0
-
/SYS/MB/RISER1/PCIE1 PCIE network-pciex8086,10fb X1109a-z/1109a-z 5.0GTx8
-
/pci@400/pci@2/pci@0/pci@8/network@0,1
-
/SYS/MB/VIDEO PCIX display-pci1a03,2000 --
-
/pci@400/pci@2/pci@0/pci@0/pci@0/display@0
-
/SYS/MB/PCIE-IO/USB PCIX usb-pciclass,0c0310 --
-
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0
-
/SYS/MB/PCIE-IO/USB PCIX usb-pciclass,0c0310 --
-
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,1
-
/SYS/MB/PCIE-IO/USB PCIX usb-pciclass,0c0320 --
-
/pci@400/pci@2/pci@0/pci@f/pci@0/usb@0,2
-
-
============================ Environmental Status ============================
-
Fan sensors:
-
----------------------------------------------------------------
-
Location Sensor Status
-
----------------------------------------------------------------
-
SYS/FANBD/FM0/F0 TACH ok
-
SYS/FANBD/FM0/F1 TACH ok
- SYS/FANBD/FM1/F0 TACH ok
- ...
3 查看CPU信息
可以使用这个命令psrinfo -pv
或者,更强大的下面这个脚本:
-
% cat showcpucount
-
-
--------------------------------------- CUT HERE -------------------------------------------
-
#!/bin/bash
-
-
/usr/bin/kstat -m cpu_info | egrep "chip_id|core_id|module: cpu_info" > /var/tmp/cpu_info.log
-
-
nproc=`(grep chip_id /var/tmp/cpu_info.log | awk '{ print $2 }' | sort -u | wc -l | tr -d ' ')`
-
ncore=`(grep core_id /var/tmp/cpu_info.log | awk '{ print $2 }' | sort -u | wc -l | tr -d ' ')`
-
vproc=`(grep 'module: cpu_info' /var/tmp/cpu_info.log | awk '{ print $4 }' | sort -u | wc -l | tr -d ' ')`
-
-
nstrandspercore=$(($vproc/$ncore))
-
ncoresperproc=$(($ncore/$nproc))
-
-
speedinmhz=`(/usr/bin/kstat -m cpu_info | grep clock_MHz | awk '{ print $2 }' | sort -u)`
-
speedinghz=`echo "scale=2; $speedinmhz/1000" | bc`
-
-
echo "Total number of physical processors: $nproc"
-
echo "Number of virtual processors: $vproc"
-
echo "Total number of cores: $ncore"
-
echo "Number of cores per physical processor: $ncoresperproc"
-
echo "Number of hardware threads (strands or vCPUs) per core: $nstrandspercore"
-
echo "Processor speed: $speedinmhz MHz ($speedinghz GHz)"
-
-
# now derive the vcpu-to-core mapping based on above information #
-
-
echo -e "\n** Socket-Core-vCPU mapping **"
-
let linenum=2
-
-
for ((i = 1; i <= ${nproc}; ++i ))
-
do
-
chipid=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $2 }'`
-
echo -e "\nPhysical Processor $i (chip id: $chipid):"
-
-
for ((j = 1; j <= ${ncoresperproc}; ++j ))
-
do
-
let linenum=($linenum + 1)
-
coreid=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $2 }'`
-
echo -e "\tCore $j (core id: $coreid):"
-
-
let linenum=($linenum - 2)
-
vcpustart=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $4 }'`
-
-
let linenum=(3 * $nstrandspercore + $linenum - 3)
-
vcpuend=`sed -n ${linenum}p /var/tmp/cpu_info.log | awk '{ print $4 }'`
-
-
echo -e "\t\tvCPU ids: $vcpustart - $vcpuend"
-
let linenum=($linenum + 4)
-
done
-
done
-
-
rm /var/tmp/cpu_info.log
-
--------------------------------------- CUT HERE -------------------------------------------
-
-
# prtdiag | head -1
-
System Configuration: Sun Microsystems sun4u SPARC Enterprise M4000 Server
-
-
# ./showcpucount
-
Total number of physical processors: 4
-
Number of virtual processors: 32
-
Total number of cores: 16
-
Number of cores per physical processor: 4
-
Number of hardware threads (strands or vCPUs) per core: 2
-
Processor speed: 2660 MHz (2.66 GHz)
-
-
** Socket-Core-vCPU mapping **
-
-
Physical Processor 1 (chip id: 1024):
-
Core 1 (core id: 0):
-
vCPU ids: 0 - 1
-
Core 2 (core id: 2):
-
vCPU ids: 2 - 3
-
Core 3 (core id: 4):
-
vCPU ids: 4 - 5
-
Core 4 (core id: 6):
-
vCPU ids: 6 - 7
-
-
Physical Processor 2 (chip id: 1032):
-
Core 1 (core id: 8):
-
vCPU ids: 8 - 9
-
Core 2 (core id: 10):
-
vCPU ids: 10 - 11
-
Core 3 (core id: 12):
-
vCPU ids: 12 - 13
-
Core 4 (core id: 14):
-
vCPU ids: 14 - 15
-
-
Physical Processor 3 (chip id: 1040):
-
Core 1 (core id: 16):
-
vCPU ids: 16 - 17
-
Core 2 (core id: 18):
-
vCPU ids: 18 - 19
-
Core 3 (core id: 20):
-
vCPU ids: 20 - 21
-
Core 4 (core id: 22):
-
vCPU ids: 22 - 23
-
-
Physical Processor 4 (chip id: 1048):
-
Core 1 (core id: 24):
-
vCPU ids: 24 - 25
-
Core 2 (core id: 26):
-
vCPU ids: 26 - 27
-
Core 3 (core id: 28):
-
vCPU ids: 28 - 29
-
Core 4 (core id: 30):
- 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
|
|