author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 26 Feb 2016 21:58:15 +0000 (22:58 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 26 Feb 2016 21:58:15 +0000 (22:58 +0100) |
configure.ac | patch | blob | history | |
src/apache.c | patch | blob | history | |
src/collectd.conf.in | patch | blob | history | |
src/modbus.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index fc1e11c1e1e6eb1e2b4ac1b4a451bf3041d05f1b..e2c6be6bbe869bf873ab1ada2a69e838711c9d7b 100644 (file)
--- a/configure.ac
+++ b/configure.ac
#
AC_PROG_CC
AC_PROG_CPP
+AC_PROG_EGREP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
+AC_CACHE_CHECK([if bison is the parser generator],
+ [collectd_cv_prog_bison],
+ [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
+ [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
+ )]
+)
+
+if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/liboconfig/parser.c"
+then
+ AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/liboconfig/parser.c. Please install bison])
+fi
+
AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
if test "x$have_protoc_c" = "xno"
then
diff --git a/src/apache.c b/src/apache.c
index b306032b6c55fddb512b17c0fb24aa252271dbf2..38035caa22e94cfdeeaac8ef1047ddf443a40fdd 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
st = user_data->data;
+ int status;
+
+ char *content_type;
+ static const char *text_plain = "text/plain";
+
assert (st->url != NULL);
/* (Assured by `config_add') */
if (st->curl == NULL)
{
- int status;
-
status = init_host (st);
if (status != 0)
return (-1);
st->server_type = APACHE;
}
+ status = curl_easy_getinfo (st->curl, CURLINFO_CONTENT_TYPE, &content_type);
+ if ((status == CURLE_OK) && (content_type != NULL) &&
+ (strncasecmp (content_type, text_plain, strlen (text_plain)) != 0))
+ {
+ WARNING ("apache plugin: `Content-Type' response header is not `%s' "
+ "(received: `%s'). Expecting unparseable data. Please check `URL' "
+ "parameter (missing `?auto' suffix ?)",
+ text_plain, content_type);
+ }
+
ptr = st->apache_buffer;
saveptr = NULL;
while ((line = strtok_r (ptr, "\n\r", &saveptr)) != NULL)
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 953b5e4c0d89fda3a31ec98d95f0e7bf52d1d3d3..f57241da2a40213e1a8ed41cf069c68dbf415179 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# Lines beginning with a single `#' belong to plugins which have been built #
# but are disabled by default. #
# #
-# Lines begnning with `##' belong to plugins which have not been built due #
+# Lines beginning with `##' belong to plugins which have not been built due #
# to missing dependencies or because they have been deactivated explicitly. #
##############################################################################
diff --git a/src/modbus.c b/src/modbus.c
index d2b0a535ff9a0dd135f05fe2b217145ccc9c0315..d538fb3f717774bbc36b6c2eb7b7e1ff0919bc85 100644 (file)
--- a/src/modbus.c
+++ b/src/modbus.c
if (host == NULL)
return (EINVAL);
+#if COLLECT_DEBUG
modbus_set_debug (&host->connection, 1);
+#endif
/* We'll do the error handling ourselves. */
modbus_set_error_handling (&host->connection, NOP_ON_ERROR);
}
}
+#if COLLECT_DEBUG
modbus_set_debug (host->connection, 1);
+#endif
/* We'll do the error handling ourselves. */
modbus_set_error_recovery (host->connection, 0);