-
Notifications
You must be signed in to change notification settings - Fork 2
/
sysinfo2
executable file
·47 lines (38 loc) · 1.22 KB
/
sysinfo2
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
#!/bin/bash
HOST=$(hostname)
CPU=$(egrep '^(vendor_id|Hardware)' /proc/cpuinfo | cut -f2 -d: | sort -u | sed 's/.*\(Genuine\|Authentic\)//g; s/[[:space:]]\+//g;' | tr '[A-Z]' '[a-z]')
CPU=${CPU:-unknown}
[[ -d "/proc/bus/pci" ]] && PCI="pci"
[[ -d "/proc/scsi" ]] && SCSI="scsi"
for i in cpu usb ${PCI} ${SCSI}
do
if [ -n "$(which ls${i})" ]
then
file="${HOST}.${CPU}.${i}"
eval "ls${i}" > "${file}"
else
echo "can't find tool: ls${i}"
fi
done
if [ -n "$(which smartctl)" -a -r "${HOST}.${CPU}.scsi" ]
then
for i in $(grep ATA "${HOST}.${CPU}.scsi" | sed 's/.*\/dev\///g;')
do
smartctl -a /dev/$i
done > "${HOST}.${CPU}.smartctl"
fi
cat /proc/cpuinfo > "${HOST}.${CPU}.proccpu"
[[ -n "$(which dmidecode)" ]] && dmidecode > "${HOST}.${CPU}.dmi"
#egrep '^(vendor_id|model name|Hardware|Model)' /proc/cpuinfo | sort -fiu
#Hardware : BCM2835
#model name : ARMv6-compatible processor rev 7 (v6l)
#Model : Raspberry Pi Model B Rev 1
#vendor_id :
#Hardware :
#model name : Intel(R) Xeon(R) CPU X5690 @ 3.47GHz
#Model :
#vendor_id : GenuineIntel
#Hardware :
#model name : AMD Ryzen 5 2600 Six-Core Processor
#Model :
#vendor_id : AuthenticAMD