Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- graphql, linux, typescript
Hướng nghiên cứu
Bộ lọc nằm trong read() tại api/src/unraid-api/graph/resolvers/metrics/temperature/sensors/lm_sensors.service.ts. Hiện tại nó chấp nhận mọi khóa kết thúc bằng _input và luôn đặt CELSIUS. Hãy bắt đầu từ đó và giới hạn các khóa được chấp nhận thành temp<n>_input có giá trị số, loại trừ quạt, điện áp và công suất. Hoàn thành khi truy vấn GraphQL cho metrics.temperature.sensors chỉ trả về bốn số đo nhiệt độ từ bước tái hiện, không còn unit: CELSIUS trên giá trị quạt hoặc điện áp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 123
- Fork
- 25
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của unraid/api
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullableĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
parityHistory query fails with NaN when a parity-checks.log record has an empty errors fieldĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mckinsey/agents-at-scale-ark#4091 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
NUS-Project-SaBai/project-sabai#386 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
android needs clarification
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
super-productivity/super-productivity#12105 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày