public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container 0/1] Add a module for hardware sensors reading
@ 2025-10-14 19:36 Davide Guerri via pve-devel
  0 siblings, 0 replies; only message in thread
From: Davide Guerri via pve-devel @ 2025-10-14 19:36 UTC (permalink / raw)
  To: pve-devel; +Cc: Davide Guerri

[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-14 21:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-14 19:36 [pve-devel] [PATCH container 0/1] Add a module for hardware sensors reading Davide Guerri via pve-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal