X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvarnish.c;h=5de3389d862eb41828b5fb73a55f1d5fe2197104;hb=44dcf2017576cbd398574ac66a732a5d2b179c3c;hp=de60e39c7b21759f0fdefb062d3d74475df90fed;hpb=76a7816d2c066f2feff5c77e7da58df4dbc982c2;p=collectd.git diff --git a/src/varnish.c b/src/varnish.c index de60e39c..5de3389d 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -1,8 +1,8 @@ /** * 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 @@ -20,7 +20,7 @@ * Authors: * Jérôme Renard * Marc Fournier - * Florian octo Forster + * Florian octo Forster **/ /** @@ -412,11 +412,21 @@ static int varnish_read (user_data_t *ud) /* {{{ */ 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."); @@ -593,7 +603,9 @@ static int varnish_config_instance (const oconfig_item_t *ci) /* {{{ */ else { WARNING ("Varnish plugin: Ignoring unknown " - "configuration option: \"%s\"", + "configuration option: \"%s\". Did " + "you forget to add an " + "block around the configuration?", child->key); } }