UPS: read NUT as well as apcupsd in upsDevices
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Start by reading UPSService.getUPSData() and createUPSDevice, which the issue identifies as the apcupsd data path and placeholder mapping. Check how UPS configuration is exposed, then trace how the NUT plugin provides its configured NAME and IPADDR for server and client modes. Done means NUT readings map to the listed UPSDevice fields when apcupsd returns no data, with the proposed source and configuration signals handled consistently.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem?
upsDevices only reads apcupsd (UPSService.getUPSData() runs /sbin/apcaccess). Many Unraid servers monitor their UPS with NUT instead, through the popular NUT plugin, often as a NUT client of another box (a firewall or another server) that the UPS is plugged into. On those servers apcupsd is disabled, apcaccess returns nothing, and upsDevices fails with Failed to get UPS data: No UPS data returned from apcaccess. So API clients can't show the UPS the server actually depends on, even though the webGUI shows it through the NUT plugin.
Related: #1765 (a NUT user seeing wrong values in a mobile client) and #1825 (placeholder values returned when no UPS is connected).
Describe the solution you'd like
When apcupsd has no data and NUT is configured, read the UPS through NUT (upsc <ups>@<host>, or the NUT network protocol on port 3493 using the plugin's configured NAME / IPADDR, which works in both server and client mode), and map it onto the existing UPSDevice fields:
| UPSDevice field | NUT variable |
|---|---|
model |
device.model / ups.model |
status |
ups.status (OL, OB, LB, ...), mapped to the same words as apcupsd |
battery.chargeLevel |
battery.charge |
battery.estimatedRuntime |
battery.runtime (already seconds) |
power.inputVoltage |
input.voltage |
power.outputVoltage |
output.voltage |
power.loadPercentage |
ups.load |
power.nominalPower |
ups.realpower.nominal |
A source field (APCUPSD / NUT) on UPSDevice or UPSConfiguration would help clients explain where the data comes from.
Describe alternatives you've considered
- Enabling apcupsd alongside NUT: not supported; the two conflict over the USB device, and a NUT client has no local UPS to read.
- Querying NUT directly from the client: needs another port and credentials outside the API, and only works on the LAN.
Additional context
While adding a UPS card to an Android client (urrt) on API 4.37.5, two more things showed up:
upsConfiguration.serviceis the useful "is a UPS configured" signal for apcupsd, but there is no equivalent for NUT, so a client can't tell "no UPS" from "UPS monitored by NUT".- When an apcaccess field is missing,
createUPSDevicefills in placeholders (LOADPCT25,BCHARGE100,TIMELEFT60 min,LINEV/OUTPUTV120.5, model "APC Back-UPS Pro 1500",healthalways "Good"). A client can't tell those from real readings. Returningnullfor missing values (the fields would need to become nullable) would let clients show "unknown" instead. This overlaps #1825.
Environment (if relevant)
Unraid OS Version: 7.3.3 and 7.4.0-rc.1 (API 4.37.5). The server is a NUT client (MODE="slave") of a NUT server on the firewall; apcupsd disabled.
Pre-submission Checklist
- I have searched existing issues to ensure this feature hasn't already been requested
- This is not an Unraid Connect related feature (if it is, please submit via the support form instead)
- I have provided clear examples or use cases for the feature
- Ngôn ngữ chính
- TypeScript
- Star
- 115
- Fork
- 23
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 7
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/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 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose per-VM details and stats on VmDomain (vCPUs, memory, disks, IPs, autostart, live usage)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
unraid/api#2113 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
cursor/community-plugins#465 ·
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 66/100
vetro-protocol/vetro-monorepo#978 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-generated bug category:security effort:s priority:p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
LanternOps/breeze#9697 ·
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 68/100
maniator/verticopolis#1303 · 1 bình luận ·
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 73/100
components-web-app/docs#297 ·