projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial support of GPSd in collectd.
[collectd.git]
/
src
/
varnish.c
diff --git
a/src/varnish.c
b/src/varnish.c
index
8e6d95e
..
1089222
100644
(file)
--- a/
src/varnish.c
+++ b/
src/varnish.c
@@
-29,19
+29,19
@@
#include "configfile.h"
#if HAVE_VARNISH_V4
#include "configfile.h"
#if HAVE_VARNISH_V4
-#include <va
rnish/va
pi/vsm.h>
-#include <va
rnish/va
pi/vsc.h>
+#include <vapi/vsm.h>
+#include <vapi/vsc.h>
typedef struct VSC_C_main c_varnish_stats_t;
#endif
#if HAVE_VARNISH_V3
typedef struct VSC_C_main c_varnish_stats_t;
#endif
#if HAVE_VARNISH_V3
-#include <varnish
/varnish
api.h>
-#include <v
arnish/v
sc.h>
+#include <varnishapi.h>
+#include <vsc.h>
typedef struct VSC_C_main c_varnish_stats_t;
#endif
#if HAVE_VARNISH_V2
typedef struct VSC_C_main c_varnish_stats_t;
#endif
#if HAVE_VARNISH_V2
-#include <varnish
/varnish
api.h>
+#include <varnishapi.h>
typedef struct varnish_stats c_varnish_stats_t;
#endif
typedef struct varnish_stats c_varnish_stats_t;
#endif
@@
-608,6
+608,7
@@
static int varnish_read (user_data_t *ud) /* {{{ */
status = VSM_n_Arg (vd, conf->instance);
if (status < 0)
{
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);
ERROR ("varnish plugin: VSM_n_Arg (\"%s\") failed "
"with status %i.",
conf->instance, status);
@@
-621,7
+622,8
@@
static int varnish_read (user_data_t *ud) /* {{{ */
if (VSM_Open (vd))
#endif
{
if (VSM_Open (vd))
#endif
{
- ERROR ("varnish plugin: Unable to load statistics.");
+ VSM_Delete (vd);
+ ERROR ("varnish plugin: Unable to open connection.");
return (-1);
}
return (-1);
}
@@
-631,9
+633,17
@@
static int varnish_read (user_data_t *ud) /* {{{ */
#else /* if HAVE_VARNISH_V4 */
stats = VSC_Main(vd, NULL);
#endif
#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);
varnish_monitor (conf, stats);
- VSM_
Clos
e (vd);
+ VSM_
Delet
e (vd);
return (0);
} /* }}} */
return (0);
} /* }}} */