rr icon indicating copy to clipboard operation
rr copied to clipboard

新smartctl插件使用反馈

Open gasment opened this issue 1 year ago • 1 comments

请填写以下信息.
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.)
...

gasment avatar Nov 22 '24 16:11 gasment

https://github.com/RROrg/rr/issues/4407 没环境,不知道,你试试吧

wjz304 avatar Nov 25 '24 05:11 wjz304

v25.8.1

wjz304 avatar Sep 07 '25 14:09 wjz304