[pve-devel] r5649 - in pve-cluster/trunk: data data/perl data/src debian

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Mar 7 12:53:22 CET 2011


Author: dietmar
Date: 2011-03-07 12:53:22 +0100 (Mon, 07 Mar 2011)
New Revision: 5649

Modified:
   pve-cluster/trunk/data/ChangeLog
   pve-cluster/trunk/data/Makefile.in
   pve-cluster/trunk/data/configure
   pve-cluster/trunk/data/configure.in
   pve-cluster/trunk/data/perl/Cluster.pm
   pve-cluster/trunk/data/perl/Makefile
   pve-cluster/trunk/data/perl/Makefile.in
   pve-cluster/trunk/data/src/Makefile.am
   pve-cluster/trunk/data/src/Makefile.in
   pve-cluster/trunk/data/src/status.c
   pve-cluster/trunk/debian/control
Log:

start rrd integration



Modified: pve-cluster/trunk/data/ChangeLog
===================================================================
--- pve-cluster/trunk/data/ChangeLog	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/ChangeLog	2011-03-07 11:53:22 UTC (rev 5649)
@@ -1,3 +1,7 @@
+2011-03-07  Proxmox Support Team  <support at proxmox.com>
+
+	* perl/Cluster.pm (broadcast_rrd): start rrd integration
+
 2011-02-25  Proxmox Support Team  <support at proxmox.com>
 
 	* perl/Cluster.pm (cfs_lock_storage): impl.

Modified: pve-cluster/trunk/data/Makefile.in
===================================================================
--- pve-cluster/trunk/data/Makefile.in	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/Makefile.in	2011-03-07 11:53:22 UTC (rev 5649)
@@ -134,6 +134,8 @@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
+LIBRRD_CFLAGS = @LIBRRD_CFLAGS@
+LIBRRD_LIBS = @LIBRRD_LIBS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@

Modified: pve-cluster/trunk/data/configure
===================================================================
--- pve-cluster/trunk/data/configure	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/configure	2011-03-07 11:53:22 UTC (rev 5649)
@@ -612,6 +612,8 @@
 FUSE_CFLAGS
 GLIB_LIBS
 GLIB_CFLAGS
+LIBRRD_LIBS
+LIBRRD_CFLAGS
 CHECK_LIBS
 CHECK_CFLAGS
 PKG_CONFIG_LIBDIR
@@ -717,6 +719,8 @@
 PKG_CONFIG_LIBDIR
 CHECK_CFLAGS
 CHECK_LIBS
+LIBRRD_CFLAGS
+LIBRRD_LIBS
 GLIB_CFLAGS
 GLIB_LIBS
 FUSE_CFLAGS
@@ -1365,6 +1369,9 @@
   CHECK_CFLAGS
               C compiler flags for CHECK, overriding pkg-config
   CHECK_LIBS  linker flags for CHECK, overriding pkg-config
+  LIBRRD_CFLAGS
+              C compiler flags for LIBRRD, overriding pkg-config
+  LIBRRD_LIBS linker flags for LIBRRD, overriding pkg-config
   GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
   GLIB_LIBS   linker flags for GLIB, overriding pkg-config
   FUSE_CFLAGS C compiler flags for FUSE, overriding pkg-config
@@ -3939,12 +3946,14 @@
 fi
 
 
+# Checks for libraries.
 
 
 
 
 
 
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
@@ -4128,9 +4137,79 @@
 	HAVE_CHECK="yes"
 fi
 
-# Checks for libraries.
 
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBRRD" >&5
+$as_echo_n "checking for LIBRRD... " >&6; }
 
+if test -n "$LIBRRD_CFLAGS"; then
+    pkg_cv_LIBRRD_CFLAGS="$LIBRRD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"librrd >= 1.4.3\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "librrd >= 1.4.3") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBRRD_CFLAGS=`$PKG_CONFIG --cflags "librrd >= 1.4.3" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$LIBRRD_LIBS"; then
+    pkg_cv_LIBRRD_LIBS="$LIBRRD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"librrd >= 1.4.3\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "librrd >= 1.4.3") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBRRD_LIBS=`$PKG_CONFIG --libs "librrd >= 1.4.3" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        LIBRRD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "librrd >= 1.4.3" 2>&1`
+        else
+	        LIBRRD_PKG_ERRORS=`$PKG_CONFIG --print-errors "librrd >= 1.4.3" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$LIBRRD_PKG_ERRORS" >&5
+
+	as_fn_error $? "librrd not found" "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	as_fn_error $? "librrd not found" "$LINENO" 5
+else
+	LIBRRD_CFLAGS=$pkg_cv_LIBRRD_CFLAGS
+	LIBRRD_LIBS=$pkg_cv_LIBRRD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	HAVE_LIBRRD="yes"
+fi
+
+
+
+
 pkg_failed=no
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
 $as_echo_n "checking for GLIB... " >&6; }

Modified: pve-cluster/trunk/data/configure.in
===================================================================
--- pve-cluster/trunk/data/configure.in	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/configure.in	2011-03-07 11:53:22 UTC (rev 5649)
@@ -16,10 +16,15 @@
 AC_PROG_CC
 AC_PROG_RANLIB
 
+# Checks for libraries.
+
 PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],
 HAVE_CHECK="yes", AC_MSG_ERROR([check not found])) 
 
-# Checks for libraries.
+PKG_CHECK_MODULES([LIBRRD], [librrd >= 1.4.3],
+HAVE_LIBRRD="yes", AC_MSG_ERROR([librrd not found])) 
+AC_SUBST(LIBRRD_CFLAGS)
+AC_SUBST(LIBRRD_LIBS)
 
 PKG_CHECK_MODULES(GLIB, 
 glib-2.0 >= 2.2.0 gthread-2.0 >= 2.2.0, 

Modified: pve-cluster/trunk/data/perl/Cluster.pm
===================================================================
--- pve-cluster/trunk/data/perl/Cluster.pm	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/perl/Cluster.pm	2011-03-07 11:53:22 UTC (rev 5649)
@@ -267,7 +267,8 @@
     my ($name, $data) = @_;
 
     # update status
-    my $bindata = pack "Z[256]Z*", $name, encode_json($data);
+    my $bindata = pack "Z[256]Z*", $name, ref($data) ? encode_json($data) : $data;
+
     return &$ipcc_send_rec(4, $bindata);
 };
 
@@ -396,6 +397,17 @@
     return  &$ipcc_get_status("vminfo", $nodename);
 }
 
+sub broadcast_rrd {
+    my ($rrdid, $data) = @_;
+
+    eval {
+	&$ipcc_update_status("rrd/$rrdid", $data);
+    };
+    my $err = $@;
+
+    warn $err if $err;
+}
+
 # a fast way to read files (avoid fuse overhead)
 sub get_config {
     my ($path) = @_;

Modified: pve-cluster/trunk/data/perl/Makefile
===================================================================
--- pve-cluster/trunk/data/perl/Makefile	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/perl/Makefile	2011-03-07 11:53:22 UTC (rev 5649)
@@ -124,6 +124,8 @@
 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
 LDFLAGS = 
 LIBOBJS = 
+LIBRRD_CFLAGS =  
+LIBRRD_LIBS = -lrrd  
 LIBS = 
 LTLIBOBJS = 
 MAINT = #

Modified: pve-cluster/trunk/data/perl/Makefile.in
===================================================================
--- pve-cluster/trunk/data/perl/Makefile.in	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/perl/Makefile.in	2011-03-07 11:53:22 UTC (rev 5649)
@@ -124,6 +124,8 @@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
+LIBRRD_CFLAGS = @LIBRRD_CFLAGS@
+LIBRRD_LIBS = @LIBRRD_LIBS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@

Modified: pve-cluster/trunk/data/src/Makefile.am
===================================================================
--- pve-cluster/trunk/data/src/Makefile.am	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/src/Makefile.am	2011-03-07 11:53:22 UTC (rev 5649)
@@ -40,7 +40,7 @@
 	memdb.c
 
 # add -lprofiler for google perftools
-CFLAGS =  -g -O -std=gnu99 -Wall $(COROSYNC_CFLAGS) $(SQLITE3_CFLAGS) $(FUSE_CFLAGS) $(QB_CFLAGS) $(GLIB_CFLAGS) 
-LDADD = libpmxcfs.a $(COROSYNC_LIBS) $(SQLITE3_LIBS) $(FUSE_LIBS) $(QB_LIBS) $(GLIB_LIBS)
+CFLAGS =  -g -O -std=gnu99 -Wall $(COROSYNC_CFLAGS) $(SQLITE3_CFLAGS) $(FUSE_CFLAGS) $(QB_CFLAGS) $(GLIB_CFLAGS) $(LIBRRD_CFLAGS) 
+LDADD = libpmxcfs.a $(COROSYNC_LIBS) $(SQLITE3_LIBS) $(FUSE_LIBS) $(QB_LIBS) $(GLIB_LIBS) $(LIBRRD_LIBS)
 
 CLEANFILES = *~
\ No newline at end of file

Modified: pve-cluster/trunk/data/src/Makefile.in
===================================================================
--- pve-cluster/trunk/data/src/Makefile.in	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/src/Makefile.in	2011-03-07 11:53:22 UTC (rev 5649)
@@ -67,7 +67,8 @@
 am__DEPENDENCIES_1 =
 am__DEPENDENCIES_2 = libpmxcfs.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 check_memdb_DEPENDENCIES = $(am__DEPENDENCIES_2)
 check_memdb_LINK = $(CCLD) $(check_memdb_CFLAGS) $(CFLAGS) \
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
@@ -76,13 +77,15 @@
 logtest_LDADD = $(LDADD)
 logtest_DEPENDENCIES = libpmxcfs.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 am_pmxcfs_OBJECTS = pmxcfs.$(OBJEXT)
 pmxcfs_OBJECTS = $(am_pmxcfs_OBJECTS)
 pmxcfs_LDADD = $(LDADD)
 pmxcfs_DEPENDENCIES = libpmxcfs.a $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
@@ -110,7 +113,7 @@
 CCDEPMODE = @CCDEPMODE@
 
 # add -lprofiler for google perftools
-CFLAGS = -g -O -std=gnu99 -Wall $(COROSYNC_CFLAGS) $(SQLITE3_CFLAGS) $(FUSE_CFLAGS) $(QB_CFLAGS) $(GLIB_CFLAGS) 
+CFLAGS = -g -O -std=gnu99 -Wall $(COROSYNC_CFLAGS) $(SQLITE3_CFLAGS) $(FUSE_CFLAGS) $(QB_CFLAGS) $(GLIB_CFLAGS) $(LIBRRD_CFLAGS) 
 CHECK_CFLAGS = @CHECK_CFLAGS@
 CHECK_LIBS = @CHECK_LIBS@
 COROSYNC_CFLAGS = @COROSYNC_CFLAGS@
@@ -137,6 +140,8 @@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
+LIBRRD_CFLAGS = @LIBRRD_CFLAGS@
+LIBRRD_LIBS = @LIBRRD_LIBS@
 LIBS = @LIBS@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
@@ -239,7 +244,7 @@
 	memdb.h			\
 	memdb.c
 
-LDADD = libpmxcfs.a $(COROSYNC_LIBS) $(SQLITE3_LIBS) $(FUSE_LIBS) $(QB_LIBS) $(GLIB_LIBS)
+LDADD = libpmxcfs.a $(COROSYNC_LIBS) $(SQLITE3_LIBS) $(FUSE_LIBS) $(QB_LIBS) $(GLIB_LIBS) $(LIBRRD_LIBS)
 CLEANFILES = *~
 all: all-am
 

Modified: pve-cluster/trunk/data/src/status.c
===================================================================
--- pve-cluster/trunk/data/src/status.c	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/data/src/status.c	2011-03-07 11:53:22 UTC (rev 5649)
@@ -30,6 +30,8 @@
 #include <errno.h>
 #include <glib.h>
 #include <sys/syslog.h>
+#include <rrd.h>
+#include <time.h>
 
 #include "cfs-utils.h"
 #include "status.h"
@@ -60,6 +62,13 @@
 } kventry_t;
 
 typedef struct {
+	char *key;
+	gpointer data;
+	size_t len;
+	uint32_t time;
+} rrdentry_t;
+
+typedef struct {
 	char *path;
 	uint32_t version;
 } memdb_change_t;
@@ -87,6 +96,7 @@
 
 	dfsm_t *kvstore;
 	GHashTable *kvhash;
+	GHashTable *rrdhash;
 
 	GHashTable *memdb_changes;
 
@@ -307,6 +317,23 @@
 				     (GDestroyNotify)kventry_free);
 }
 
+static void 
+rrdentry_free(rrdentry_t *entry)
+{
+	g_return_if_fail(entry != NULL);
+
+	g_free(entry->key);
+	g_free(entry->data);
+	g_free(entry);
+}
+
+static GHashTable *
+rrdentry_hash_new(void) 
+{
+	return g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
+				     (GDestroyNotify)rrdentry_free);
+}
+
 void 
 cfs_cluster_log_dump(GString *str, const char *user, guint max_entries)
 {
@@ -339,6 +366,8 @@
 
 	cfs_status.kvhash = kventry_hash_new();
 
+	cfs_status.rrdhash = rrdentry_hash_new();
+
 	cfs_status.memdb_changes = g_hash_table_new(g_str_hash, g_str_equal);
 
 	for (int i = 0; i < G_N_ELEMENTS(memdb_change_array); i++) {
@@ -377,6 +406,11 @@
 		cfs_status.kvhash = NULL;
 	}
 
+	if (cfs_status.rrdhash) {
+		g_hash_table_destroy(cfs_status.rrdhash);
+		cfs_status.rrdhash = NULL;
+	}
+
 	if (cfs_status.clusterlog)
 		clusterlog_destroy(cfs_status.clusterlog);
 
@@ -745,6 +779,135 @@
 	return TRUE;
 }
 
+static char *rrd_def_node[] = {
+	"create",
+	NULL, /* filename */
+	"-b",
+	NULL, /* starttime */
+	"--step", "60",
+	"DS:loadavg:GAUGE:120:0:U",
+	"DS:cpu:GAUGE:120:0:1",
+	"DS:iowait:GAUGE:120:0:1",
+	"DS:memtotal:GAUGE:120:0:U",
+	"DS:memused:GAUGE:120:0:U",
+	"DS:swaptotal:GAUGE:120:0:U",
+	"DS:swapused:GAUGE:120:0:U",
+	"DS:roottotal:GAUGE:120:0:U",
+	"DS:rootused:GAUGE:120:0:U",
+
+	"RRA:AVERAGE:0.5:1:70", // 1 min avg - one hour
+	"RRA:AVERAGE:0.5:30:70", // 30 min avg - one day
+	"RRA:AVERAGE:0.5:180:70", // 3 hour avg - one week
+	"RRA:AVERAGE:0.5:720:70", // 12 hour avg - one month
+	"RRA:AVERAGE:0.5:10080:70", // 7 day avg - ony year
+	
+	"RRA:MAX:0.5:1:70", // 1 min max - one hour
+	"RRA:MAX:0.5:30:70", // 30 min max - one day
+	"RRA:MAX:0.5:180:70",  // 3 hour max - one week
+	"RRA:MAX:0.5:720:70", // 12 hour max - one month
+	"RRA:MAX:0.5:10080:70", // 7 day max - ony year
+	NULL,
+};
+
+
+#define RRDDIR "/var/lib/rrdcached/db"
+
+static void 
+update_rrd_data(
+	const char *key,
+	gconstpointer data,
+	size_t len)
+{
+	g_return_if_fail(key != NULL);
+	g_return_if_fail(data != NULL);
+	g_return_if_fail(len > 0);
+	g_return_if_fail(len < 4096);
+
+	// fixme: when do we remove old entries ?
+
+	/* make sure we are 0 terminated */
+	char databuf[4096];
+	memcpy(databuf, data, len);
+	databuf[len] = 0;
+
+	if (strncmp(key, "pve-nodes/", 10) == 0) {
+		const char *node = key + 10;
+		g_return_if_fail(strchr(node, '/') == NULL);
+		
+		char *filename = g_strdup_printf(RRDDIR "/pve-nodes/%s", node);
+
+		if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
+
+			/* start at day boundary */
+			time_t ctime;
+			time(&ctime);
+			struct tm *ltm = localtime(&ctime);
+			ltm->tm_sec = 0;
+			ltm->tm_min = 0;
+			ltm->tm_hour = 0;
+
+			char *start = g_strdup_printf("%lu", timelocal(ltm));
+
+			int argcount = sizeof(rrd_def_node)/sizeof(void*) - 1;
+
+			rrd_def_node[1] = filename;
+			rrd_def_node[3] = start;
+
+			mkdir(RRDDIR "/pve-nodes", 0755);
+			if (rrd_create(argcount, rrd_def_node) != 0) {
+				cfs_message("RRD create error %s: %s", filename, rrd_get_error());
+			}
+
+			g_free(start);
+		}
+
+		char *update_args[] = {
+			"update", filename, databuf, 
+			NULL,
+		};
+
+		if (rrd_update(3, update_args) != 0) {
+			cfs_message("RRD update error %s: %s", filename, rrd_get_error());
+		}
+		
+		g_free(filename);
+	}
+}
+
+static gboolean 
+rrdentry_hash_set(
+	GHashTable *rrdhash,
+	const char *key,
+	gconstpointer data,
+	size_t len)
+{
+	g_return_val_if_fail(rrdhash != NULL, FALSE);
+	g_return_val_if_fail(key != NULL, FALSE);
+	g_return_val_if_fail(data != NULL, FALSE);
+	g_return_val_if_fail(len > 0, FALSE);
+
+	rrdentry_t *entry;
+	if ((entry = (rrdentry_t *)g_hash_table_lookup(rrdhash, key))) {
+		g_free(entry->data);
+		entry->data = g_memdup(data, len);
+		entry->len = len;
+		entry->time = time(NULL);
+	} else {
+		rrdentry_t *entry = g_new0(rrdentry_t, 1);
+
+		entry->key = g_strdup(key);
+		entry->data = g_memdup(data, len);
+		entry->len = len;
+		entry->time = time(NULL);
+
+		g_hash_table_replace(rrdhash, entry->key, entry);
+	}
+
+	update_rrd_data(key, data, len);
+
+	return TRUE;
+}
+
 static int 
 kvstore_send_update_message(
 	dfsm_t *dfsm,
@@ -904,8 +1067,13 @@
 
 	g_static_mutex_lock (&mutex);
 
-	gboolean res = kventry_hash_set(cfs_status.kvhash, key, data, len);
+	gboolean res;
 
+	if (strncmp(key, "rrd/", 4) == 0) {
+		res = rrdentry_hash_set(cfs_status.rrdhash, key + 4, data, len);
+	} else {
+		res = kventry_hash_set(cfs_status.kvhash, key, data, len);
+	}
 	g_static_mutex_unlock (&mutex);
 
 	if (cfs_status.kvstore) 
@@ -936,14 +1104,20 @@
 		
 	cfs_debug("got node %d status update %s", nodeid, key); 
 
-	if (!clnode->kvhash) {
-		if (!(clnode->kvhash = kventry_hash_new())) {
-			goto ret; /*ignore */
+	if (strncmp(key, "rrd/", 4) == 0) {
+
+		rrdentry_hash_set(cfs_status.rrdhash, key + 4, data, len);
+
+	} else {
+		if (!clnode->kvhash) {
+			if (!(clnode->kvhash = kventry_hash_new())) {
+				goto ret; /*ignore */
+			}
 		}
-	}
 
-	kventry_hash_set(clnode->kvhash, key, data, len);
+		kventry_hash_set(clnode->kvhash, key, data, len);
 	
+	}
 ret:
 	g_static_mutex_unlock (&mutex);
 

Modified: pve-cluster/trunk/debian/control
===================================================================
--- pve-cluster/trunk/debian/control	2011-03-07 06:33:02 UTC (rev 5648)
+++ pve-cluster/trunk/debian/control	2011-03-07 11:53:22 UTC (rev 5649)
@@ -2,12 +2,12 @@
 Section: unknown
 Priority: extra
 Maintainer: Proxmox Support Team <support at proxmox.com>
-Build-Depends: debhelper (>= 7), autotools-dev, libsqlite3-dev, sqlite3, libfuse-dev, libcorosync-pve-dev, libqb-dev, libpve-common-perl, libglib2.0-dev, check 
+Build-Depends: debhelper (>= 7), autotools-dev, libsqlite3-dev, sqlite3, libfuse-dev, libcorosync-pve-dev, libqb-dev, libpve-common-perl, libglib2.0-dev, librrd-dev, check 
 Standards-Version: 3.7.3
 
 Package: pve-cluster
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, rsync, libsqlite3-0, sqlite3, libfuse2, libqb, libpve-common-perl, rsyslog, openssl
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, rsync, libsqlite3-0, sqlite3, libfuse2, libqb, libpve-common-perl, rsyslog, openssl, librrd4
 Description: Cluster Infrastructure for Proxmox Virtual Environment
  This package contains the Cluster Infrastructure for the Proxmox
  Virtual Environment, namely a distributed filesystem to store




More information about the pve-devel mailing list