Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新smartctl插件使用反馈 #4448

Open
gasment opened this issue Nov 22, 2024 · 1 comment
Open

新smartctl插件使用反馈 #4448

gasment opened this issue Nov 22, 2024 · 1 comment

Comments

@gasment
Copy link

gasment commented Nov 22, 2024

请填写以下信息.
Please fill in the following information.

Install ENV: (You can find it in the boot interface.)

  • DMI:
  • CPU:
  • NIC: (pid & vid)

RR version: (You can find it in the update menu.)

  • RR:
  • addons:
  • modules:
  • lkms:

DSM:

  • model: SA6400
  • version: 7.2.2

Issue:
这个劫持脚本是不是对DT机型无效?
脚本里的readlink -f "/sys/block/$(basename "${argv}")/device" 2>/dev/null | grep -q "expander"貌似无效,
我这里对手动执行
readlink -f "/sys/block/sataX/device"
返回是这样的,其中5-9是HBA,1-4是sata

root@AIO-DSM:~# readlink -f "/sys/block/sata1/device"
/sys/devices/pci0000:00/0000:00:17.0/ata5/host4/target4:0:0/4:0:0:0
root@AIO-DSM:~# readlink -f "/sys/block/sata2/device"
/sys/devices/pci0000:00/0000:00:17.0/ata6/host5/target5:0:0/5:0:0:0
root@AIO-DSM:~# readlink -f "/sys/block/sata3/device"
/sys/devices/pci0000:00/0000:00:17.0/ata7/host6/target6:0:0/6:0:0:0
root@AIO-DSM:~# readlink -f "/sys/block/sata4/device"
/sys/devices/pci0000:00/0000:00:17.0/ata8/host7/target7:0:0/7:0:0:0
root@AIO-DSM:~# readlink -f "/sys/block/sata5/device"
/sys/devices/pci0000:00/0000:00:01.1/0000:02:00.0/host8/port-8:0/end_device-8:0/target8:0:0/8:0:0:0
root@AIO-DSM:~# readlink -f "/sys/block/sata6/device"
/sys/devices/pci0000:00/0000:00:01.1/0000:02:00.0/host8/port-8:1/end_device-8:1/target8:0:1/8:0:1:0
root@AIO-DSM:~# readlink -f "/sys/block/sata7/device"
/sys/devices/pci0000:00/0000:00:01.1/0000:02:00.0/host8/port-8:2/end_device-8:2/target8:0:2/8:0:2:0
root@AIO-DSM:~# readlink -f "/sys/block/sata8/device"
/sys/devices/pci0000:00/0000:00:01.1/0000:02:00.0/host8/port-8:3/end_device-8:3/target8:0:3/8:0:3:0
root@AIO-DSM:~# readlink -f "/sys/block/sata9/device"
/sys/devices/pci0000:00/0000:00:01.1/0000:02:00.0/host8/port-8:4/end_device-8:4/target8:0:4/8:0:4:0

我改了一下脚本的grep关键词为ata

args=()

HBA=true
for argv in "$@"; do
  if [ -e "${argv}" ] && readlink -f "/sys/block/$(basename "${argv}")/device" 2>/dev/null | grep "ata"; then
    HBA=false
  fi
done

argp=""
for argv in "$@"; do
  if [ "${argp}" = "-d" ] && [ "${argv}" = "ata" ] && [ "${HBA}" = "true" ]; then
    args+=("sat")
  else
    args+=("${argv}")
  fi
  argp="${argv}"
done
echo "Final command to execute: /usr/bin/smartctl.bak ${args[@]}"
/usr/bin/smartctl.bak "${args[@]}"

手动执行smartctl已经成功劫持到了,命令行里也获取到不同温度信息,但是web页面没有效果

smartctl -d ata -A /dev/sata5
Final command to execute: /usr/bin/smartctl.bak -d sat -A /dev/sata5

这是特定型号特定版本不行呢,还是需要修改其他东西?望指点
logs:

(## 因为 log中存在 SN/MAC 等一些敏感信息, 当提供完整文件时请自行抹除他们, 当然你也可以发送到我的邮箱. ##)
(## Because the log contains some sensitive information such as SN/MAC, please delete them when providing the complete file. Of course, you can also send it to my email. ##)
...

(请先看一下#173#175#226 的内容)
(Plz review the content of #173, #175, #226 first)
...

(如果你只是说 XXX 不能用, 什么详细信息也不提供, 我也只能说感谢你的反馈.)
(If you just say XXX doesn't work without providing any details, I can only say thank you for your feedback.)
...

@wjz304
Copy link
Contributor

wjz304 commented Nov 25, 2024

#4407
没环境,不知道,你试试吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants