[pve-devel] [PATCH 2/2] add node stats

Alexandre Derumier aderumier at odiso.com
Mon Jun 22 18:07:35 CEST 2015


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 bin/pvestatd | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/bin/pvestatd b/bin/pvestatd
index 785380c..ad688a0 100755
--- a/bin/pvestatd
+++ b/bin/pvestatd
@@ -118,7 +118,18 @@ sub update_node_status {
 	my $plugin_config = $status_cfg->{ids}->{$id};
 	next if $plugin_config->{disable};
 	my $plugin = PVE::Status::Plugin->lookup($plugin_config->{type});
-	my $d = {}; # fixme: what data?
+
+	my $d = {};
+	$d->{uptime} = $uptime;
+	$d->{cpustat} = $stat;
+	$d->{cpustat}->{avg1} = $avg1;
+	$d->{cpustat}->{avg5} = $avg5;
+	$d->{cpustat}->{avg15} = $avg15;
+	$d->{cpustat}->{cpus} = $maxcpu;
+	$d->{memory} = $meminfo;
+	$d->{blockstat} = $dinfo;
+	$d->{nics} = $netdev;
+
 	$plugin->update_node_status($plugin_config, $nodename, $d, $ctime);
     }
 }
-- 
2.1.4




More information about the pve-devel mailing list