summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b20df0b)
raw | patch | inline | side by side (parent: b20df0b)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Sat, 4 Apr 2015 20:28:47 +0000 (22:28 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Sat, 4 Apr 2015 20:28:47 +0000 (22:28 +0200) |
src/collectd.conf.pod | patch | blob | history | |
src/nginx.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 652e3f4bda164c969dd5884e4d5b0f4b1c07efb6..991a8032fc34e42fc02def7c90ff9c2aefbfe27b 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
@@ -4114,6 +4114,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<notify_desktop>
diff --git a/src/nginx.c b/src/nginx.c
index b0daa05b31a555732a0f58940d732df84de3b57d..edb55b9e986e5af91eed8d0dcbc1e31499c8f106 100644 (file)
--- a/src/nginx.c
+++ b/src/nginx.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 config */
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);
} /* void init */