From: Davide Guerri via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Davide Guerri <davide.guerri@gmail.com>
Subject: [pve-devel] [PATCH container 0/1] Add a module for hardware sensors reading
Date: Tue, 14 Oct 2025 21:36:00 +0200 [thread overview]
Message-ID: <mailman.912.1760476932.390.pve-devel@lists.proxmox.com> (raw)
[-- Attachment #1: Type: message/rfc822, Size: 7969 bytes --]
From: Davide Guerri <davide.guerri@gmail.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH container 0/1] Add a module for hardware sensors reading
Date: Tue, 14 Oct 2025 21:36:00 +0200
Message-ID: <20251014193601.34285-1-davide.guerri@gmail.com>
Hardware sensors (lmsensors) reading module. This module is used by an
API andpoint that will be submitted separately on the pve-manager repo.
The module queries /sys/class/hwmon to collect sensor readings from CPUs
(Intel, AMD), disks (NVMe, SATA/SAS via drivetemp), and fans through
various hardware drivers (expected to be installed on the pve node).
The module provides functions like read_temperatures() (which can filter
by cpu/disk/other/all types) and read_fan_speeds() that return structured
hashes containing current readings, sensor metadata (driver names, limits,
CPU topology info), and device mappings.
It uses PVE::Tools utilities for file reading and directory traversal.
Example href for temperatures (disk, cpu and others can be read
separately):
# {
# 'coretemp/Core 0' => {
# temperature => 45.0, # in degrees Celsius
# unit => 'celsius',
# type => 'cpu',
# driver => 'Intel',
# max => 100.0, # optional
# critical => 100.0, # optional
# logical_core => 0, # optional, for CPU cores
# physical_core => 0, # optional, for CPU cores
# package => 0, # optional, for CPU cores
# },
# 'hwmon4/Sensor 1' => {
# temperature => 35.0, # in degrees Celsius
# unit => 'celsius',
# type => 'disk',
# driver => 'SATA/SAS',
# device => 'sda', # block device name (for disks)
# },
# 'hwmon1/Composite' => {
# temperature => 42.0, # in degrees Celsius
# unit => 'celsius',
# type => 'disk',
# driver => 'NVMe',
# device => 'nvme0n1', # block device name (for disks)
# },
# 'hwmon2/Composite' => {
# temperature => 43.0, # in degrees Celsius
# unit => 'celsius',
# type => 'disk',
# driver => 'NVMe',
# device => 'nvme1n1', # block device name (for disks)
# },
# ...
# }
Example href for fan speed reading
# {
# 'nct6775/CPU Fan' => {
# speed => 1500, # in RPM
# unit => 'rpm',
# driver => 'Nuvoton',
# min => 0, # optional
# max => 2000, # optional
# target => 1500, # optional
# alarm => 0, # optional, 0 or 1
# },
# ...
# }
Davide Guerri (1):
sensors: add hardware sensor module for CPUs, disks, and fans
src/Makefile | 1 +
src/PVE/SensorInfo.pm | 385 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 386 insertions(+)
create mode 100644 src/PVE/SensorInfo.pm
--
2.50.1 (Apple Git-155)
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
reply other threads:[~2025-10-14 21:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mailman.912.1760476932.390.pve-devel@lists.proxmox.com \
--to=pve-devel@lists.proxmox.com \
--cc=davide.guerri@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox