From: Chris Lundquist Date: Tue, 17 Jan 2012 05:10:46 +0000 (-0800) Subject: Ok it is posting to the local server X-Git-Tag: collectd-5.1.0~42^2~7 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=731f60bad6b6b051731f88051fa32876f2be6a45;p=collectd.git Ok it is posting to the local server --- diff --git a/src/write_mongodb.c b/src/write_mongodb.c index 900fb878..5ee220e1 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -101,6 +101,7 @@ static int wm_write (const data_set_t *ds, /* {{{ */ else assert (23 == 42); } + bson_finish(&record); pthread_mutex_lock (&node->lock); @@ -137,11 +138,15 @@ static int wm_write (const data_set_t *ds, /* {{{ */ if(status != MONGO_OK) { - ERROR ( "write_mongodb plugin: error inserting record: "); + ERROR ( "write_mongodb plugin: error inserting record: %d", node->conn->err); if(node->conn->err == MONGO_BSON_INVALID) { + ERROR (node->conn->errstr); + } else if ( record.err) + { ERROR (record.errstr); } + }