From: Florian Forster Date: Mon, 1 Apr 2013 14:38:08 +0000 (+0200) Subject: rrdcached plugin: Connect to the daemon in the read() callback. X-Git-Tag: collectd-5.1.3~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=df58a0a6b68ae55e9888455d30424e86b787c802;p=collectd.git rrdcached plugin: Connect to the daemon in the read() callback. Fixes Github issue #275. Thanks to Yves Mettier for reporting this bug! --- diff --git a/src/rrdcached.c b/src/rrdcached.c index 11c1c6a7..3518f2dd 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -1,6 +1,6 @@ /** * collectd - src/rrdcached.c - * Copyright (C) 2008 Florian octo Forster + * Copyright (C) 2008-2013 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,7 +16,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: - * Florian octo Forster + * Florian octo Forster **/ #include "collectd.h" @@ -275,6 +275,14 @@ static int rc_read (void) sstrncpy (vl.host, daemon_address, sizeof (vl.host)); sstrncpy (vl.plugin, "rrdcached", sizeof (vl.plugin)); + status = rrdc_connect (daemon_address); + if (status != 0) + { + ERROR ("rrdcached plugin: rrdc_connect (%s) failed with status %i.", + daemon_address, status); + return (-1); + } + head = NULL; status = rrdc_stats_get (&head); if (status != 0)