-
Notifications
You must be signed in to change notification settings - Fork 0
/
solaris.sh
16 lines (15 loc) · 1.11 KB
/
solaris.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
serverSerialInfo=$(/sbin/prtdiag -v | awk '/Chassis Serial/{getline; getline; print}')
ilomIPAddress=$(sudo /sbin/ipmitool lan print | grep -w 'IP Address' | awk -F':' '{print $2}' | awk '{getline; print}')
firmwareVersion=$(/sbin/prtdiag -v | awk '/ FW Version / {getline; getline; getline; print}')
ServerVersion=$(/sbin/prtdiag -v | grep "System Configuration" | awk -F':' '{print $2}')
diskInfo=$(/sbin/zpool list -o name,size | awk '{if(NR>1)print}')
totalCpuCores=$(kstat cpu_info|grep core_id|sort -u|wc -l)
cpuSocket=$(/sbin/psrinfo -p)
cpuCoresPerSocket=$(($totalCpuCores / $cpuSocket))
threadPerCore=$(($cpuCoresPerSocket / 2))
memoryInfo=$(/sbin/prtconf | grep Memory | awk -F':' '{print $2}')
host=$(hostname)
ipAddress=$(ping -s $host 57 1 | awk '{getline; print}' | head -n1 | awk -F" " '{print $5}')
#CpuInfo
#Sockets: $cpuSocket CoresPerSocket: $cpuCoresPerSocket ThreadsPerCore: $threadPerCore
echo $serverSerialInfo, $firmwareVersion, $ServerVersion, $memoryInfo, Sockets: $cpuSocket CoresPerSocket: $cpuCoresPerSocket ThreadsPerCore: $threadPerCore, $diskInfo, $ilomIPAddress, $ipAddress