[pve-devel] r5652 - pve-manager/pve2/bin

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Mar 7 14:48:18 CET 2011


Author: dietmar
Date: 2011-03-07 14:48:18 +0100 (Mon, 07 Mar 2011)
New Revision: 5652

Modified:
   pve-manager/pve2/bin/pvestatd
Log:
use new PVE::Cluster::broadcast_rrd


Modified: pve-manager/pve2/bin/pvestatd
===================================================================
--- pve-manager/pve2/bin/pvestatd	2011-03-07 13:46:43 UTC (rev 5651)
+++ pve-manager/pve2/bin/pvestatd	2011-03-07 13:48:18 UTC (rev 5652)
@@ -10,8 +10,17 @@
 use PVE::ProcFSTools;
 use Filesys::Df;
 use PVE::INotify;
+use PVE::Cluster;
 use Time::Local;
 
+$SIG{'__WARN__'} = sub {
+    my $err = $@;
+    my $t = $_[0];
+    chomp $t;
+    syslog('warning', "WARNING: %s", $t);
+    $@ = $err;
+};
+
 initlog('pvestatd');
 
 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
@@ -198,13 +207,9 @@
 	"$meminfo->{swaptotal}:$meminfo->{swapused}:" .
 	"$dinfo->{bavail}:$dinfo->{used}";
 
-    cond_create_node_rrd($nodename);
-    
     syslog("info", "node:$data");
 
-    my $filename = "$rrddir/pve-nodes/$nodename";
-    RRDs::update($filename, $data);
-
+    PVE::Cluster::broadcast_rrd("pve-nodes/$nodename", $data);
 }
 
 sub update_qemu_status {




More information about the pve-devel mailing list