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

Alexandre Derumier aderumier at odiso.com
Wed Dec 12 13:32:39 CET 2012


we need it for resourcestore

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

diff --git a/bin/pvestatd b/bin/pvestatd
index 5847c10..9b3c10a 100755
--- a/bin/pvestatd
+++ b/bin/pvestatd
@@ -182,18 +182,19 @@ sub update_qemu_status {
 
     foreach my $vmid (keys %$vmstatus) {
 	my $d = $vmstatus->{$vmid};
+	my $template = $d->{template} ? $d->{template} : ":";
 	my $data;
 	if ($d->{pid}) { # running
 	    $data = "$d->{uptime}:$d->{name}:$ctime:$d->{cpus}:$d->{cpu}:" .
 		"$d->{maxmem}:$d->{mem}:" .
 		"$d->{maxdisk}:$d->{disk}:" .
 		"$d->{netin}:$d->{netout}:" .
-		"$d->{diskread}:$d->{diskwrite}";
+		"$d->{diskread}:$d->{diskwrite}:$template";
 	} else {
 	    $data = "0:$d->{name}:$ctime:$d->{cpus}::" .
 		"$d->{maxmem}::" .
 		"$d->{maxdisk}:$d->{disk}:" .
-		":::";
+		"::::$template";
 	}
 	PVE::Cluster::broadcast_rrd("pve2-vm/$vmid", $data);
     }
@@ -252,12 +253,12 @@ sub update_openvz_status {
 		"$d->{maxmem}:$d->{mem}:" .
 		"$d->{maxdisk}:$d->{disk}:" .
 		"$d->{netin}:$d->{netout}:" .
-		"$d->{diskread}:$d->{diskwrite}";
+		"$d->{diskread}:$d->{diskwrite}:";
 	} else {
 	    $data = "0:$d->{name}:$ctime:$d->{cpus}::" .
 		"$d->{maxmem}::" .
 		"$d->{maxdisk}:$d->{disk}:" .
-		":::";
+		"::::";
 	}
 	PVE::Cluster::broadcast_rrd("pve2-vm/$vmid", $data);
     }
-- 
1.7.10.4




More information about the pve-devel mailing list