summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b850c79)
raw | patch | inline | side by side (parent: b850c79)
author | Florian Forster <octo@collectd.org> | |
Wed, 28 Nov 2012 07:15:29 +0000 (08:15 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 28 Nov 2012 07:15:29 +0000 (08:15 +0100) |
Fixes Github issue 202.
src/varnish.c | patch | blob | history |
diff --git a/src/varnish.c b/src/varnish.c
index de60e39c7b21759f0fdefb062d3d74475df90fed..602f47af6231f59d40b51ccbd86800d1ca31bf3d 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
/**
* collectd - src/varnish.c
- * Copyright (C) 2010 Jérôme Renard
- * Copyright (C) 2010 Marc Fournier
- * Copyright (C) 2010 Florian Forster
+ * Copyright (C) 2010 Jérôme Renard
+ * Copyright (C) 2010 Marc Fournier
+ * Copyright (C) 2010-2012 Florian 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
* Authors:
* Jérôme Renard <jerome.renard at gmail.com>
* Marc Fournier <marc.fournier at camptocamp.com>
- * Florian octo Forster <octo at verplant.org>
+ * Florian octo Forster <octo at collectd.org>
**/
/**
vd = VSM_New();
VSC_Setup(vd);
- if (VSM_n_Arg(vd, conf->instance) == -1)
+
+ if (conf->instance != NULL)
{
- ERROR ("Varnish plugin : unable to load statistics from instance");
- return (-1);
+ int status;
+
+ status = VSM_n_Arg (vd, conf->instance);
+ if (status < 0)
+ {
+ ERROR ("varnish plugin: VSM_n_Arg (\"%s\") failed "
+ "with status %i.",
+ conf->instance, status);
+ return (-1);
+ }
}
+
if (VSC_Open (vd, /* diag = */ 1))
{
ERROR ("varnish plugin: Unable to load statistics.");