From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id E755F1FF17A for ; Tue, 14 Oct 2025 23:21:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B5095CC66; Tue, 14 Oct 2025 23:22:12 +0200 (CEST) To: pve-devel@lists.proxmox.com Date: Tue, 14 Oct 2025 21:36:00 +0200 MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Davide Guerri via pve-devel Precedence: list Cc: Davide Guerri X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: [pve-devel] [PATCH container 0/1] Add a module for hardware sensors reading Content-Type: multipart/mixed; boundary="===============2426530384385752294==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============2426530384385752294== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id DFEA3DD7AA for ; Tue, 14 Oct 2025 23:22:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BE307CC10 for ; Tue, 14 Oct 2025 23:21:41 +0200 (CEST) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 14 Oct 2025 23:21:40 +0200 (CEST) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-426ed6f4db5so180915f8f.0 for ; Tue, 14 Oct 2025 14:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760476894; x=1761081694; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=h6sP8VU3iAbI5lcyTnnA82/RP5lAxV95gOzjeGIZBQc=; b=QhpghopFG3IEVN+Y9tHDyEHWGkIjO073iGO8TOOEttEiLxPbnLYKlngLh3cDIboOE0 EEQ6FHe0BjDsf9WaiWdL5nLnc+4ZqDMd806SFtTIrMD1q9xcGesYPMP0AHFNTkxFVtks oO9LvHwnwGHSEtPySn0RuPygGpxqng8m9X5oYQ25R90jM93kSyu9bXLtb9Or1vErq1OT DF38dSrXIobf5ylVjJkolXkWNMMZcwapKv9yN1h2+7AVYtJK51d+0G1IFNRypk+4Q47e ECvgk2mY7CwrT/rjucJWjVU93WbwSnHZE6FAKJKYzzbJLo8nQe64zUfg5fg/F1HtC90P kwNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760476894; x=1761081694; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=h6sP8VU3iAbI5lcyTnnA82/RP5lAxV95gOzjeGIZBQc=; b=gfsVwT/NqNX1ZcBURTRGzo6G58Ei5tTnyOss7tVgEudTfQpOHMSL1E9udGQnDDbp8X 8/jX6jMqK9xCM8hz0fQvUTHxLs6yE//6soOFPQvWBGvQvIhxFHIzsOg1iC+WAnkKOOEA 5TrTJjYJklfpMVuh2UsAH56qkWowLpYvGw4QzVujX2W/rjLeSOE3Hx7bMMp1aTcinao7 x4ktugXsT/ux9Emx9FQXhPjdhihzA5dvNCZTabtsMIVJaYNIwIqSD/4roZ8BwKUQqx5C HZDBKppb+xoy9wj409LBORkCLEA8mQFr9I/DjqxXhZ19XNjsro0lmZEIk/Bf2WvQ38jo XcQg== X-Gm-Message-State: AOJu0Yy+wa7gk7wsVcXtaIgV67Mo9tXxUtK3Fs4h+XlV4h/bFyhqTP/l KDdQJoJsk+0c3lSrEGv9GxsL+onhlZz/R8mMl/YH39sKxkF0a8rIChoNMuWAIZ2u X-Gm-Gg: ASbGncvB4hFCkbFzWk/krgdKxS06CvXLbtLUKkuCMNnHqItu3H70GYdRtyRF2iUIZLl 1w7RJMTBluE9cwqQbtmfRypihMhUsoyuD7YpOb1fuPLd7l6VB8AsrDQpOw1V4yHTCgSv4ROfU3D ulExikSqwEPGoeBcLmLyKMxPC/fyxIBypF1ktzSwHAfXga18po9ps3nWXCeLvCTemHeOGegp9FR vR6S2ui/nLzs2VB3UVaBFn3kywL9qcGQMLfUPw+qul8i3qxQ90pRYr37xTLL0STGYZrw2h5uiCJ qBNLo442JULzpNoUsRMT2oobdqmeQhbjR5LGCqu/nwb+EPvJnGYrMHRv58uL3/hwkv9DQ8QU5tp Hu1GYg80WYWRqjiRkSZORnLI5dfvDNI0jiiYakOAY7/Y5oPch70kX9lN0y4Z99MDBDQoEKN6oya jeZRae5eK7MdCi0qt2s4YZTykn92RiN3pp X-Google-Smtp-Source: AGHT+IF+LMZ2bEKJuK6DkYe8xtsPJC8E5fdADZIXLmELSTOGx2AZAfkpcB48NKsJDVrB5X7ejw4e5g== X-Received: by 2002:a05:6000:288f:b0:425:58d0:483a with SMTP id ffacd0b85a97d-425829a5a12mr21790642f8f.3.1760476893945; Tue, 14 Oct 2025 14:21:33 -0700 (PDT) Received: from lechuck (host-79-43-235-239.retail.telecomitalia.it. [79.43.235.239]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-426ce5e8207sm24999189f8f.47.2025.10.14.14.21.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 14 Oct 2025 14:21:31 -0700 (PDT) Received: by lechuck.localdomain (Postfix, from userid 502) id 930FA7527B12; Tue, 14 Oct 2025 21:36:03 +0200 (CEST) From: Davide Guerri 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> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.100 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record 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) --===============2426530384385752294== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============2426530384385752294==--