summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 24c2f24)
raw | patch | inline | side by side (parent: 24c2f24)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 4 Jul 2015 21:04:30 +0000 (23:04 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 10 Jul 2015 09:27:14 +0000 (11:27 +0200) |
src/varnish.c | patch | blob | history |
diff --git a/src/varnish.c b/src/varnish.c
index 8e6d95eefadb2c8cced71ceb87c22643457f648b..b96226105cfe31222e99a4c126c4390c7c04808f 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
status = VSM_n_Arg (vd, conf->instance);
if (status < 0)
{
+ VSM_Delete (vd);
ERROR ("varnish plugin: VSM_n_Arg (\"%s\") failed "
"with status %i.",
conf->instance, status);
if (VSM_Open (vd))
#endif
{
- ERROR ("varnish plugin: Unable to load statistics.");
+ VSM_Delete (vd);
+ ERROR ("varnish plugin: Unable to open connection.");
return (-1);
}
#else /* if HAVE_VARNISH_V4 */
stats = VSC_Main(vd, NULL);
#endif
+ if (!stats)
+ {
+ VSM_Delete (vd);
+ ERROR ("varnish plugin: Unable to get statistics.");
+
+ return (-1);
+ }
+
varnish_monitor (conf, stats);
VSM_Close (vd);