X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_redis.c;h=1e7281cb3243d64d725dbb42a8db6a552b042ce2;hb=dee232ec86cb375f00096117475a6f21cf56e015;hp=40f9074b0630be90fcf18bbfcec7dcc434d42b18;hpb=809a89739bd92a5432deb6230a68dd6e6bbb72b3;p=collectd.git diff --git a/src/write_redis.c b/src/write_redis.c index 40f9074b..1e7281cb 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -111,11 +111,12 @@ static int wr_write (const data_set_t *ds, /* {{{ */ if (node->conn == NULL) { node->conn = redisConnectWithTimeout ((char *)node->host, node->port, node->timeout); - if (node->conn == NULL) + if (node->conn != NULL && node->conn->err) { - ERROR ("write_redis plugin: Connecting to host \"%s\" (port %i) failed.", + ERROR ("write_redis plugin: Connecting to host \"%s\" (port %i) failed: %s", (node->host != NULL) ? node->host : "localhost", - (node->port != 0) ? node->port : 6379); + (node->port != 0) ? node->port : 6379, + node->conn->errstr); pthread_mutex_unlock (&node->lock); return (-1); }