[pve-devel] [PATCH manager 3/5] api: nodes: rrd and rrddata fetch from new pve9-node rrd files if present
    Aaron Lauterer 
    a.lauterer at proxmox.com
       
    Fri May 23 18:37:41 CEST 2025
    
    
  
if the new rrd pve9-node files are present, they contain the current
data and should be used.
Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 PVE/API2/Nodes.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 791d2dec..dd12c1ce 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -841,8 +841,10 @@ __PACKAGE__->register_method({
     code => sub {
 	my ($param) = @_;
 
+	my $path = "pve9-node/$param->{node}";
+	$path = "pve2-node/$param->{node}" if !-e $path;
 	return PVE::RRD::create_rrd_graph(
-	    "pve2-node/$param->{node}", $param->{timeframe},
+	    $path, $param->{timeframe},
 	    $param->{ds}, $param->{cf});
 
     }});
@@ -883,8 +885,10 @@ __PACKAGE__->register_method({
     code => sub {
 	my ($param) = @_;
 
+	my $path = "pve9-node/$param->{node}";
+	$path = "pve2-node/$param->{node}" if !-e "/var/lib/rrdcached/db/${path}";
 	return PVE::RRD::create_rrd_data(
-	    "pve2-node/$param->{node}", $param->{timeframe}, $param->{cf});
+	    $path, $param->{timeframe}, $param->{cf});
     }});
 
 __PACKAGE__->register_method({
-- 
2.39.5
    
    
More information about the pve-devel
mailing list