From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 501001FF0A7 for ; Wed, 02 Sep 2026 17:00:34 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 99E3421553; Wed, 02 Sep 2026 17:00:09 +0200 (CEST) From: Shan Shaji To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v2 1/6] fix: nodes: update `idle` key value in hash reference Date: Wed, 2 Sep 2026 16:59:39 +0200 Message-ID: <20260902145944.365185-2-s.shaji@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260902145944.365185-1-s.shaji@proxmox.com> References: <20260902145944.365185-1-s.shaji@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788361192063 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.349 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VLEE2NC355P2JBLAO2BLJNO7LBIALGHG X-Message-ID-Hash: VLEE2NC355P2JBLAO2BLJNO7LBIALGHG X-MailFrom: s.shaji@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Previously, the /status endpoint returned 0 for the `idle` field because the idle value read from /proc/uptime was not being used to update the hash reference. Fix this by setting the hash reference's `idle` key to the parsed value. Signed-off-by: Shan Shaji --- PVE/API2/Nodes.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 2ca3244d..603f4a06 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -369,6 +369,11 @@ __PACKAGE__->register_method({ additionalProperties => 1, properties => { # TODO: document remaining ones + idle => { + type => "integer", + minimum => 0, + description => "Sum of how much time each core has spent idle, in seconds.", + }, 'boot-info' => { description => "Meta-information about the boot mode.", type => 'object', @@ -500,6 +505,7 @@ __PACKAGE__->register_method({ my ($uptime, $idle) = PVE::ProcFSTools::read_proc_uptime(); $res->{uptime} = $uptime; + $res->{idle} = $idle; my ($avg1, $avg5, $avg15) = PVE::ProcFSTools::read_loadavg(); $res->{loadavg} = [$avg1, $avg5, $avg15]; -- 2.47.3