-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbasicinfo.sh
executable file
·77 lines (63 loc) · 2.63 KB
/
basicinfo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
hostname_node=`hostname`
collect_basicinfo()
{
date_dir=`date "+%Y_%m_%d_%H_%M_%S"_client`
echo hostname_node $hostname_node > 1
physicalNumber=0
coreNumber=0
logicalNumber=0
HTNumber=0
logicalNumber=$(grep "processor" /proc/cpuinfo|sort -u|wc -l)
physicalNumber=$(grep "physical id" /proc/cpuinfo|sort -u|wc -l)
coreNumber=$(grep "cpu cores" /proc/cpuinfo|uniq|awk -F':' '{print $2}'|xargs)
HTNumber=$((logicalNumber / (physicalNumber * coreNumber)))
echo ""
echo ""
echo "******************************* CPU Information *****************************"
echo "CPUINFO:" `cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c`
echo "Logical CPU Number : ${logicalNumber}"
echo "Physical CPU Number : ${physicalNumber}"
echo "CPU Core Number : ${coreNumber}"
echo "HT Number : ${HTNumber}"
echo ""
echo ""
echo "**************************** Memory Information *****************************"
cat /proc/meminfo |grep "MemTotal:"|awk '{print $2}'
size_gb=`cat /proc/meminfo |grep "MemTotal"|awk '{print int($2)/1024/1024}'`
echo $size_gb GB
dmidecode |grep -A16 "Memory Device$"|grep Type
echo ""
echo ""
echo "**************************** Brand Information ******************************"
dmidecode | grep -A15 "System Information"
echo ""
echo ""
#echo "Mac_INFO:" `ifconfig -a|grep "ether"`
#echo "IP_Address:" `ifconfig |grep '[0-9]\{1,3\}\.[0-9]\{1,3\}\.'|awk -F " " '{print $2;print "\n"}'`
#echo "RELEASE_VERSION:" `cat /etc/redhat-release` >> ./$date_dir/basicinfo_client.log
#echo `ethtool -i eth0` >> ./$date_dir/basicinfo_client.log
#echo `ethtool -k eth0` >> ./$date_dir/basicinfo_client.log
#ip a a
#uname -a >> ./$date_dir/basicinfo_client.log
#fdisk -l >>./$date_dir/basicinfo_client.log
echo "************************ Ethernet Information ******************************"
lspci |grep Ethernet
echo "**************************** OS Information ********************************"
lsb_release -a
echo "************************ Kernel Information ******************************"
uname -a
echo "************************ Disk Information ******************************"
hdparm -W /dev/sd*
lsblk
echo "************************ Raid Information ******************************"
lspci |grep RAID
rm -rf memoryinfo
echo ===================================================================
}
dmidecode -t memory > ${hostname_node}_basicinfo.log
cat ${hostname_node}_basicinfo.log|grep Type >> ${hostname_node}_basicinfo.log
lspci -vvv >> ${hostname_node}_basicinfo.log
cat ${hostname_node}_basicinfo.log |grep NVM >> ${hostname_node}_basicinfo.log
echo *******************************
collect_basicinfo >> ${hostname_node}_basicinfo.log