From: Erik Fastermann <e.fastermann@proxmox.com>
To: pbs-devel@lists.proxmox.com
Cc: Erik Fastermann <e.fastermann@proxmox.com>
Subject: [PATCH proxmox-backup] fix #7187: report: add ethtool output for physical interfaces
Date: Fri, 8 May 2026 14:48:26 +0200 [thread overview]
Message-ID: <20260508124826.3228-1-e.fastermann@proxmox.com> (raw)
Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
NOTE: A similar patch was applied to all products:
pmg, pve, pbs, pdm.
src/server/report.rs | 65 ++++++++++++++++++++++++++++++--------------
1 file changed, 44 insertions(+), 21 deletions(-)
diff --git a/src/server/report.rs b/src/server/report.rs
index e4c761cdb..46218b79e 100644
--- a/src/server/report.rs
+++ b/src/server/report.rs
@@ -2,6 +2,8 @@ use std::fmt::Write;
use std::path::Path;
use std::process::Command;
+use proxmox_network_api::NetworkInterfaceType;
+
fn get_top_processes() -> String {
let (exe, args) = ("top", vec!["-b", "-c", "-w512", "-n", "1", "-o", "TIME"]);
let output = Command::new(exe).args(&args).output();
@@ -63,34 +65,55 @@ fn files() -> Vec<(&'static str, Vec<&'static str>)> {
]
}
-fn commands() -> Vec<(&'static str, Vec<&'static str>)> {
- vec![
- // ("<command>", vec![<arg [, arg]>])
- ("date", vec!["-R"]),
- ("proxmox-backup-manager", vec!["versions", "--verbose"]),
- ("proxmox-backup-manager", vec!["subscription", "get"]),
- ("proxmox-backup-manager", vec!["ldap", "list"]),
- ("proxmox-backup-manager", vec!["openid", "list"]),
- ("proxmox-boot-tool", vec!["status"]),
- ("df", vec!["-h"]),
+fn commands() -> Vec<(&'static str, Vec<String>)> {
+ // ("<command>", vec![<arg [, arg]>])
+ const BASE_COMMANDS: &[(&str, &[&str])] = &[
+ ("date", &["-R"]),
+ ("proxmox-backup-manager", &["versions", "--verbose"]),
+ ("proxmox-backup-manager", &["subscription", "get"]),
+ ("proxmox-backup-manager", &["ldap", "list"]),
+ ("proxmox-backup-manager", &["openid", "list"]),
+ ("proxmox-boot-tool", &["status"]),
+ ("df", &["-h"]),
(
"lsblk",
- vec![
+ &[
"--ascii",
"-M",
"-o",
"+HOTPLUG,ROTA,PHY-SEC,FSTYPE,MODEL,TRAN",
],
),
- ("bash", vec!["-c", "ls -l /dev/disk/by-*/"]),
- ("zpool", vec!["status"]),
- ("zfs", vec!["list"]),
- ("zarcstat", vec![]),
- ("dmidecode", vec!["-t", "bios"]),
- ("lscpu", vec![]),
- ("lspci", vec!["-nnk"]),
- ("ip", vec!["-details", "-statistics", "a"]),
- ]
+ ("bash", &["-c", "ls -l /dev/disk/by-*/"]),
+ ("zpool", &["status"]),
+ ("zfs", &["list"]),
+ ("zarcstat", &[]),
+ ("dmidecode", &["-t", "bios"]),
+ ("lscpu", &[]),
+ ("lspci", &["-nnk"]),
+ ("ip", &["-details", "-statistics", "a"]),
+ ];
+
+ let mut commands: Vec<_> = BASE_COMMANDS
+ .into_iter()
+ .map(|(cmd, args)| (*cmd, args.into_iter().map(|arg| arg.to_string()).collect()))
+ .collect();
+
+ match proxmox_network_api::config() {
+ Ok((config, _)) => {
+ let ethtool_commands = config
+ .interfaces
+ .into_iter()
+ .filter(|(_, iface)| iface.interface_type == NetworkInterfaceType::Eth)
+ .map(|(name, _)| ("ethtool", vec![name]));
+ commands.extend(ethtool_commands)
+ }
+ Err(err) => {
+ eprintln!("error while querying network interfaces: {err}")
+ }
+ };
+
+ commands
}
// (description, function())
@@ -160,7 +183,7 @@ fn get_directory_content(path: impl AsRef<Path>) -> String {
out
}
-fn get_command_output(exe: &str, args: &Vec<&str>) -> String {
+fn get_command_output(exe: &str, args: &[String]) -> String {
let output = Command::new(exe)
.env("PROXMOX_OUTPUT_NO_BORDER", "1")
.args(args)
--
2.47.3
reply other threads:[~2026-05-08 12:49 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=20260508124826.3228-1-e.fastermann@proxmox.com \
--to=e.fastermann@proxmox.com \
--cc=pbs-devel@lists.proxmox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.