summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 293ef78)
raw | patch | inline | side by side (parent: 293ef78)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Sat, 4 Apr 2015 20:29:22 +0000 (22:29 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Sat, 4 Apr 2015 20:29:22 +0000 (22:29 +0200) |
src/ascent.c | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history |
diff --git a/src/ascent.c b/src/ascent.c
index e9d25bd551743885e2257c4751d285af42d6193b..66640d999e6645bf5aaf8a38f6df8a93331e6a1f 100644 (file)
--- a/src/ascent.c
+++ b/src/ascent.c
static char *verify_peer = NULL;
static char *verify_host = NULL;
static char *cacert = NULL;
+static char *timeout = NULL;
static CURL *curl = NULL;
"Password",
"VerifyPeer",
"VerifyHost",
- "CACert"
+ "CACert",
+ "Timeout",
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
return (config_set (&verify_host, value));
else if (strcasecmp (key, "CACert") == 0)
return (config_set (&cacert, value));
+ else if (strcasecmp (key, "Timeout") == 0)
+ return (config_set (&timeout, value));
else
return (-1);
} /* }}} int ascent_config */
if (cacert != NULL)
curl_easy_setopt (curl, CURLOPT_CAINFO, cacert);
+ if (timeout != NULL)
+ curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, atoi(timeout));
+ else
+ curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS,
+ CDTIME_T_TO_MS(plugin_get_interval()));
+
return (0);
} /* }}} int ascent_init */
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 991a8032fc34e42fc02def7c90ff9c2aefbfe27b..25bb25a42a04a8f1c06b1ca1e5533d1bac5ed647 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
@@ -869,6 +869,12 @@ File that holds one or more SSL certificates. If you want to use HTTPS you will
possibly need this option. What CA certificates come bundled with C<libcurl>
and are checked by default depends on the distribution you use.
+=item B<Timeout> I<Milliseconds>
+
+The B<Timeout> option sets the overall timeout for HTTP requests, in
+milliseconds. By default, the configured B<Interval> is used to set the
+timeout.
+
=back
=head2 Plugin C<barometer>