[pve-devel] [PATCH 4/9] pvestatd : add template value to rrd

Alexandre Derumier aderumier at odiso.com
Tue Jan 15 10:01:04 CET 2013


we need it for resourcestore

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 bin/pvestatd |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/bin/pvestatd b/bin/pvestatd
index d986606..81f7357 100755
--- a/bin/pvestatd
+++ b/bin/pvestatd
@@ -226,20 +226,23 @@ sub update_qemu_status {
 
     foreach my $vmid (keys %$vmstatus) {
 	my $d = $vmstatus->{$vmid};
+	my $template = $d->{template} ? $d->{template} : "0";
 	my $data;
+
 	if ($d->{pid}) { # running
-	    $data = "$d->{uptime}:$d->{name}:$ctime:$d->{cpus}:$d->{cpu}:" .
+	    $data = "$d->{uptime}:$d->{name}:$template:$ctime:$d->{cpus}:$d->{cpu}:" .
 		"$d->{maxmem}:$d->{mem}:" .
 		"$d->{maxdisk}:$d->{disk}:" .
 		"$d->{netin}:$d->{netout}:" .
 		"$d->{diskread}:$d->{diskwrite}";
 	} else {
-	    $data = "0:$d->{name}:$ctime:$d->{cpus}::" .
+	    $data = "0:$d->{name}:$template:$ctime:$d->{cpus}::" .
 		"$d->{maxmem}::" .
 		"$d->{maxdisk}:$d->{disk}:" .
 		":::";
 	}
-	PVE::Cluster::broadcast_rrd("pve2-vm/$vmid", $data);
+
+	PVE::Cluster::broadcast_rrd("pve2.3-vm/$vmid", $data);
     }
 }
 
@@ -292,18 +295,20 @@ sub update_openvz_status {
 	my $d = $vmstatus->{$vmid};
 	my $data;
 	if ($d->{status} eq 'running') { # running
-	    $data = "$d->{uptime}:$d->{name}:$ctime:$d->{cpus}:$d->{cpu}:" .
+	    $data = "$d->{uptime}:$d->{name}:0:$ctime:$d->{cpus}:$d->{cpu}:" .
 		"$d->{maxmem}:$d->{mem}:" .
 		"$d->{maxdisk}:$d->{disk}:" .
 		"$d->{netin}:$d->{netout}:" .
 		"$d->{diskread}:$d->{diskwrite}";
 	} else {
-	    $data = "0:$d->{name}:$ctime:$d->{cpus}::" .
+	    $data = "0:$d->{name}:0:$ctime:$d->{cpus}::" .
 		"$d->{maxmem}::" .
 		"$d->{maxdisk}:$d->{disk}:" .
 		":::";
 	}
-	PVE::Cluster::broadcast_rrd("pve2-vm/$vmid", $data);
+
+	PVE::Cluster::broadcast_rrd("pve2.3-vm/$vmid", $data);
+
     }
 }
 
-- 
1.7.10.4




More information about the pve-devel mailing list