Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liyapeng
/
log_collect
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9c8142bd
authored
Feb 06, 2024
by
liyapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化收集日志细节
1 parent
8e1c52ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
log_collect.sh
log_collect.sh
View file @
9c8142b
...
...
@@ -5,7 +5,7 @@ TMP_SECRET_ID=${COS_TMP_SECRET_ID}
TMP_SECRET_KEY
=
${
COS_TMP_SECRET_KEY
}
TMP_SESSION_TOKEN
=
${
COS_TMP_SESSION_TOKEN
}
BUCKET_NAME
=
'log-collection-1310972338'
ENDPOINT
=
'cos.ap-
bei
jing.myqcloud.com'
ENDPOINT
=
'cos.ap-
nan
jing.myqcloud.com'
CURRENT_DATE
=
$(
date +%Y%m%d
)
LOG_DIR
=
"
$(
hostname
)
-
${
CURRENT_DATE
}
-log"
LOG_FILE_PATH
=
"/tmp/
${
LOG_DIR
}
"
...
...
@@ -79,6 +79,7 @@ GPULogCollect() {
lspci -vvv >>
${
LOG_FILE_PATH
}
/GPULogCollect/lspci-nvidia.log
dmesg -T >
${
LOG_FILE_PATH
}
/GPULogCollect/dmesg-gpu.log
journalctl | grep -i nvrm > journalctl_nvrm.txt
dmidecode -t slot > slot-all.txt
# get slot info
touch
${
LOG_FILE_PATH
}
/GPULogCollect/slot-info.txt
nvidia-smi --query-gpu
=
index,gpu_name,gpu_bus_id,uuid --format
=
csv >
${
LOG_FILE_PATH
}
/GPULogCollect/slot-info.txt
...
...
@@ -104,6 +105,7 @@ sosreportLOG() {
sosreport --batch
fi
cp /tmp/sosreport
*
${
LOG_FILE_PATH
}
/
rm /tmp/sosreport
*
}
Bundlinglogfiles
()
{
...
...
@@ -113,7 +115,11 @@ Bundlinglogfiles() {
uploadlogfile
()
{
echo
"upload log file"
chmod +x coscli
if
[
-z
"
$TMP_SESSION_TOKEN
"
]
;
then
./coscli -c ./.cos.yaml -e
${
ENDPOINT
}
-i
${
TMP_SECRET_ID
}
-k
${
TMP_SECRET_KEY
}
cp /tmp/
${
LOG_DIR
}
.tar cos://
${
BUCKET_NAME
}
/
${
LOG_DIR
}
.tar
else
./coscli -c ./.cos.yaml -e
${
ENDPOINT
}
-i
${
TMP_SECRET_ID
}
-k
${
TMP_SECRET_KEY
}
--token
${
TMP_SESSION_TOKEN
}
cp /tmp/
${
LOG_DIR
}
.tar cos://
${
BUCKET_NAME
}
/
${
LOG_DIR
}
.tar
fi
}
main
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment