Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- graphql, linux, typescript
调研方向
过滤逻辑位于 api/src/unraid-api/graph/resolvers/metrics/temperature/sensors/lm_sensors.service.ts 中的 read()。目前它接受任何以 _input 结尾的键,并且总是设置 CELSIUS。从这里开始,将接受的键限制为带数值的 temp<n>_input,排除风扇、电压和功率。完成标准是:metrics.temperature.sensors 的 GraphQL 查询只返回复现中的四个温度读数,风扇或电压值上不再带有 unit: CELSIUS。
由索引模型根据 Issue 内容生成。
描述
Environment
Unraid OS Version: 7.4.0 (Unraid API 4.37.12)
Are you using a reverse proxy? No, direct access (http://:5000)
Pre-submission Checklist
- I have verified that my Unraid OS is up to date
- I have tested this issue by accessing my server directly (not through a reverse proxy)
- This is not an Unraid Connect related issue
Issue Description
metrics.temperature.sensors contains every value of sensors -j that ends with _input, not only temperatures. Voltages (in*_input), fan speeds (fan*_input) and power (power*_input) are returned as temperature sensors with unit: CELSIUS and type: CUSTOM.
Cause: LmSensorsService.read() in api/src/unraid-api/graph/resolvers/metrics/temperature/sensors/lm_sensors.service.ts only checks key.endsWith('_input') and always sets TemperatureUnit.CELSIUS.
Steps to Reproduce
- Server with a Super-I/O chip that exposes voltages and fans via lm-sensors (here: Fintek
f71868a, plusfam15h_power) - Query
{ metrics { temperature { sensors { id name type current { value unit } } } } } - Look at the returned sensors
Expected Behavior
Only temperature readings (temp*_input) are returned as temperature sensors.
Actual Behavior
16 sensors are returned, only 4 of them are temperatures. Examples:
| id (key part) | value | real meaning |
|---|---|---|
f71868a-isa-0e80:3VSB:in7_input |
3.3 | voltage (V) |
f71868a-isa-0e80:Array Fan:fan2_input |
1570 | fan (RPM) |
fam15h_power-pci-00c4:power1:power1_input |
106.96 | power (W) |
f71868a-isa-0e80:MB Temp:temp1_input |
45 | temperature (correct) |
All of them come with unit: CELSIUS, so clients show e.g. "1570 °C" for a fan. Status/thresholds based on these values are meaningless as well.
Additional Context
Possible fix: in read(), only accept keys matching /^temp\d+_input$/ (lm-sensors naming), e.g.
if (!/^temp\d+_input$/.test(key) || typeof value !== 'number') continue;
Fans/voltages could be exposed separately later (see #1560 / #1598), but they should not appear in the temperature metrics.
Noticed while working on the ioBroker Unraid adapter (https://github.com/ingel81/ioBroker.unraid), which now filters these readings on its side.
- 主要语言
- TypeScript
- 星标
- 123
- 派生
- 25
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
unraid/api 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullable未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
难度 2/5 1-3 小时 新手友好度 68/100
mckinsey/agents-at-scale-ark#4091 · 1 条评论 ·
维护者通常 1 天内回复
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 94/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
NUS-Project-SaBai/project-sabai#386 ·
维护者通常 3 天内回复
-
android needs clarification
难度 2/5 1-3 小时 新手友好度 72/100
super-productivity/super-productivity#12105 · 3 条评论 ·
维护者通常 1 天内回复