[pve-devel] [PATCH manager] use physical NIC regexp

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon May 22 09:44:18 CEST 2017


because in >= Stretch, most systems don't have ethX devices any more.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
Note: requires patch introducing this RE in pve-common

 PVE/Service/pvestatd.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index bc62b90..2c8454d 100755
--- a/PVE/Service/pvestatd.pm
+++ b/PVE/Service/pvestatd.pm
@@ -12,6 +12,7 @@ use PVE::ProcFSTools;
 use PVE::CpuSet;
 use Filesys::Df;
 use PVE::INotify;
+use PVE::Network;
 use PVE::Cluster qw(cfs_read_file);
 use PVE::Storage;
 use PVE::QemuServer;
@@ -94,7 +95,7 @@ sub update_node_status {
     my $netin = 0;
     my $netout = 0;
     foreach my $dev (keys %$netdev) {
-	next if $dev !~ m/^eth\d+$/;
+	next if $dev !~ m/^$PVE::Network::PHYSICAL_NIC_RE$/;
 	$netin += $netdev->{$dev}->{receive};
 	$netout += $netdev->{$dev}->{transmit};
     }
-- 
2.1.4





More information about the pve-devel mailing list