summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c279c0e)
raw | patch | inline | side by side (parent: c279c0e)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Sat, 4 Apr 2015 20:27:53 +0000 (22:27 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Sat, 4 Apr 2015 20:27:53 +0000 (22:27 +0200) |
src/bind.c | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history |
diff --git a/src/bind.c b/src/bind.c
index 59eb24913ce7008f4f789f6fe6a5cad299618ede..c36cf482a00226308f9e94b0e00787925291543a 100644 (file)
--- a/src/bind.c
+++ b/src/bind.c
static int global_zone_maint_stats = 1;
static int global_resolver_stats = 0;
static int global_memory_stats = 1;
+static int timeout = -1;
static cb_view_t *views = NULL;
static size_t views_num = 0;
bind_config_add_view (child);
else if (strcasecmp ("ParseTime", child->key) == 0)
cf_util_get_boolean (child, &config_parse_time);
+ else if (strcasecmp ("Timeout", child->key) == 0)
+ cf_util_get_int (child, &timeout);
else
{
WARNING ("bind plugin: Unknown configuration option "
curl_easy_setopt (curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL);
curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt (curl, CURLOPT_MAXREDIRS, 50L);
+ curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS, (timeout >= 0) ?
+ timeout : CDTIME_T_TO_MS(plugin_get_interval()));
+
return (0);
} /* }}} int bind_init */
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 07ef54f101222fba8bfc992832d54952d1a0c9dc..652e3f4bda164c969dd5884e4d5b0f4b1c07efb6 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
Default: Enabled.
+=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.
+
=item B<View> I<Name>
Collect statistics about a specific I<"view">. BIND can behave different,