Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dcu_env_check
Commits
7a9822e6
Commit
7a9822e6
authored
May 14, 2025
by
liumg
Browse files
Update system_check.sh
add board_check/pcie_speed_check
parent
ad46ba80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
13 deletions
+36
-13
system_check.sh
system_check.sh
+36
-13
No files found.
system_check.sh
View file @
7a9822e6
...
@@ -52,9 +52,27 @@ done
...
@@ -52,9 +52,27 @@ done
:
${
LOG_SIZE_LIMIT
:
=
$DEFAULT_LOG_SIZE_LIMIT
}
:
${
LOG_SIZE_LIMIT
:
=
$DEFAULT_LOG_SIZE_LIMIT
}
init_check
()
{
local
pkgs_debian
=(
dmidecode lshw pciutils numactl-devel
)
local
pkgs_centos
=(
dmidecode lshw pciutils numactl-dev
)
local
cmd
=(
dmidecode lshw lspci numactl
)
for
((
i
=
0
;
i<
${#
cmd
[@]; i++
}
))
;
do
if
!
command
-v
$cmd
[
i] &>/dev/null
;
then
if
command
-v
apt-get &>/dev/null
;
then
echo
"没有
$cmd
[i] 命令,请先安装
$pkgs_debian
[i]"
apt-get
install
-y
pciutils
elif
command
-v
yum &>/dev/null
;
then
echo
"没有
$cmd
[i] 命令,请先安装
$pkgs_centos
[i]"
yum
install
-y
pciutils
fi
fi
done
}
declare
-A
devices_id
=(
declare
-A
devices_id
=(
[
"
z
100"
]=
"54b7"
[
"
Z
100"
]=
"54b7"
[
"Z100L"
]=
"55b7"
[
"Z100L"
]=
"55b7"
[
"K100"
]=
"62b7"
[
"K100"
]=
"62b7"
[
"K100-AI"
]=
"6210"
[
"K100-AI"
]=
"6210"
...
@@ -66,7 +84,7 @@ declare -A devices_id=(
...
@@ -66,7 +84,7 @@ declare -A devices_id=(
declare
-A
devices
declare
-A
devices
for
name
in
"
${
!devices_id[@]
}
"
;
do
for
name
in
"
${
!devices_id[@]
}
"
;
do
id
=
"
${
devices_id
[
$name
]
}
"
id
=
"
${
devices_id
[
$name
]
}
"
devices[
"
${
id
}
"
]
+
=
"
$name
"
# 统一转大写处理
devices[
"
${
id
}
"
]
+
=
"
$name
"
done
done
get_dcu
()
{
get_dcu
()
{
...
@@ -269,7 +287,7 @@ analyze_regions() {
...
@@ -269,7 +287,7 @@ analyze_regions() {
fi
fi
if
[[
"
$address
"
==
"<ignored>"
]]
;
then
if
[[
"
$address
"
==
"<ignored>"
]]
;
then
echo
"[ERROR] 获取不到bar地址"
echo
"[ERROR] 获取不到bar地址"
echo
"
修复建议:检查/proc/cmdline是否包含'pcie=realloc'配置"
echo
"修复建议:检查/proc/cmdline是否包含'pcie=realloc'配置"
grep
-q
"pcie=realloc"
/proc/cmdline
||
echo
" 当前配置:
$(
cat
/proc/cmdline
)
"
grep
-q
"pcie=realloc"
/proc/cmdline
||
echo
" 当前配置:
$(
cat
/proc/cmdline
)
"
return
3
return
3
fi
fi
...
@@ -305,7 +323,7 @@ sme_check() {
...
@@ -305,7 +323,7 @@ sme_check() {
echo
"OS SME目前没有打开, 非CSV场景下,该状态正常"
echo
"OS SME目前没有打开, 非CSV场景下,该状态正常"
fi
fi
}
}
# 驱动安装位置定位
kernel_check
()
{
kernel_check
()
{
# 当前kernel版本
# 当前kernel版本
kernel_version
=
`
uname
-r
`
kernel_version
=
`
uname
-r
`
...
@@ -318,6 +336,8 @@ kernel_check() {
...
@@ -318,6 +336,8 @@ kernel_check() {
echo
"你的内核可能有所变更,检查下环境是否是多个内核"
echo
"你的内核可能有所变更,检查下环境是否是多个内核"
fi
fi
}
}
# 驱动
# 分析错误信息
# 分析错误信息
analyze_errors
()
{
analyze_errors
()
{
...
@@ -343,11 +363,9 @@ analyze_errors() {
...
@@ -343,11 +363,9 @@ analyze_errors() {
## 标准化提示信息格式
## 标准化提示信息格式
head_normal
()
{
head_normal
()
{
echo
echo
"
\n
########
$1
########"
echo
"########
$1
########"
}
}
# 主流程
# 主流程
main
()
{
main
()
{
hline
&&
echo
hline
&&
echo
...
@@ -356,18 +374,23 @@ main() {
...
@@ -356,18 +374,23 @@ main() {
collect_logs
collect_logs
#analyze_errors
#analyze_errors
get_pcie_info
get_pcie_info
echo
echo
"### 日志分析 ###"
echo
"
\n
### 日志分析 ###"
hline
&&
echo
hline
head_normal
"分析pcie信息"
head_normal
"分析pcie信息"
pcie_check
$OUTPUT_DIR
/pcie_info.log
pcie_check
$OUTPUT_DIR
/pcie_info.log
head_normal
"分析sme信息"
head_normal
"分析sme信息"
sme_check
$OUTPUT_DIR
/dmesg.log
sme_check
$OUTPUT_DIR
/dmesg.log
head_normal 分析驱动安装位置
head_normal
"
分析驱动安装位置
"
kernel_check
kernel_check
./driver_load_check.sh
>
$OUTPUT_DIR
/driver_status.log
./driver_load_check.sh
>
$OUTPUT_DIR
/driver_status.log
local
status
=
$?
./board_check.sh
>
$OUTPUT_DIR
/board_check.log
product_name
=
`
dmidecode
-s
system-product-name
`
if
[
"
$product_name
"
!=
"X785-H30"
]
;
then
./pcie_speed_check.sh
>
$OUTPUT_DIR
/pcie_speek_check.log
fi
local
status
=
$?
# 打包结果
# 打包结果
log
"打包诊断数据..."
log
"打包诊断数据..."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment