-
Notifications
You must be signed in to change notification settings - Fork 0
/
system-info.sh
executable file
·79 lines (63 loc) · 1.34 KB
/
system-info.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
78
#!/usr/bin/env bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
REPORT_FILE=system-info-report-$(date +%s).txt
touch ${REPORT_FILE} && chmod 0600 ${REPORT_FILE}
function _header() {
echo -e "\n***** $* *****\n"
}
function r_meminfo() {
_header "Memory"
cat /proc/meminfo | tee -a ${REPORT_FILE}
}
function r_cpuinfo() {
_header "CPU"
cat /proc/cpuinfo | tee -a ${REPORT_FILE}
}
function r_proc_version() {
_header "Linux version"
cat /proc/version | tee -a ${REPORT_FILE}
}
function r_lsb_release() {
_header "distribution-specific information"
lsb_release -a | tee -a ${REPORT_FILE}
}
function r_lspci() {
_header "PCI"
lspci | tee -a ${REPORT_FILE}
}
function r_lsusb() {
_header "USB"
lsusb | tee -a ${REPORT_FILE}
}
function r_lsblk() {
_header "Block devices"
lsblk | tee -a ${REPORT_FILE}
}
function r_fdisk() {
_header "Disks and partitions"
fdisk -l | tee -a ${REPORT_FILE}
}
function r_lshw() {
_header "Hardware"
lshw | tee -a ${REPORT_FILE}
}
function r_dmidecode {
_header "DMI/BIOS information"
dmidecode | tee -a ${REPORT_FILE}
}
##
## call all the above report functions:
r_meminfo
r_cpuinfo
r_proc_version
r_lsb_release
r_lspci
r_lsusb
r_lsblk
r_fdisk
r_lshw
r_dmidecode
##
## save REPORT_FILE
chmod 0400 ${REPORT_FILE}
_header "Report file written: ${REPORT_FILE}."