From 3f23b3bbdb74b18966d190edad228299b5c78af9 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Thu, 28 Jun 2018 13:49:45 +0300 Subject: updated configs.signatures --- configs.signatures | 1 + 1 file changed, 1 insertion(+) diff --git a/configs.signatures b/configs.signatures index 1c6b7fc908..04b2a79205 100644 --- a/configs.signatures +++ b/configs.signatures @@ -586,6 +586,7 @@ declare -A configs_signatures=( ['ce0fa3485a0d8d3aa80b25ab0c70cc5a']='charts.d/apcupsd.conf' ['ce2e8768964a936f58c4c2144aee8a01']='health_alarm_notify.conf' ['ce3b65eac6c472b21905f7f72104f4c9']='python.d/nginx.conf' + ['ce937f8b9ab7820b61ce9fcde6b946e8']='charts.d/nut.conf' ['cf2c9096b3a8c506a3ec76fa52574395']='charts.d/phpfpm.conf' ['cf46545065f7698c4d529fdc77955274']='python.d/puppet.conf' ['cf48dfd828af70bea04db7a809f94358']='health.d/haproxy.conf' -- cgit v1.2.3 From ee0a14d9dc20e4413c2990fde107411866f02d0a Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Thu, 28 Jun 2018 13:54:44 +0300 Subject: increase js version numbers to uncache CDN --- web/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/index.html b/web/index.html index 29e2a292c0..42a9a1007b 100644 --- a/web/index.html +++ b/web/index.html @@ -4406,7 +4406,7 @@ }); NETDATA.requiredJs.push({ - url: NETDATA.serverStatic + 'dashboard_info.js?v20180622-1', + url: NETDATA.serverStatic + 'dashboard_info.js?v20180628-1', async: false, isAlreadyLoaded: function() { return false; } }); @@ -5728,6 +5728,6 @@ - + -- cgit v1.2.3 From 27144c33444346030f262359a03abacb432af493 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 29 Jun 2018 00:30:17 +0800 Subject: Sign CLA --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 857694c14d..384e06f4a1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -88,3 +88,4 @@ username|name|email (optional) @davidak|David Kleuker|netdata-contributors+vyff@davidak.de @ccremer|Christian Cremer| @jimcooley|Jim Cooley|jim.cooley@healthvana.com +@Chocobo1|Mike Tzou| -- cgit v1.2.3 From 7c00033f587f75d5d2ea7be8a3e0d5678122c76a Mon Sep 17 00:00:00 2001 From: Dimosthenis Kaponis Date: Fri, 29 Jun 2018 23:00:59 +0300 Subject: Fix redis auth --- python.d/redis.chart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python.d/redis.chart.py b/python.d/redis.chart.py index a40932b3aa..f924d55bf5 100644 --- a/python.d/redis.chart.py +++ b/python.d/redis.chart.py @@ -152,7 +152,7 @@ class Service(SocketService): resp = self._get_raw_data(request=self.auth_request) if not resp: return False - if not resp.strip() != '+OK': + if resp.strip() != '+OK': self.error("invalid password") return False return True -- cgit v1.2.3 From 733c700f16f5548eafbf625a835066860a3478d9 Mon Sep 17 00:00:00 2001 From: cosmix Date: Sat, 30 Jun 2018 08:54:13 +0300 Subject: Sign CLA. --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 384e06f4a1..d1c391e691 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -89,3 +89,4 @@ username|name|email (optional) @ccremer|Christian Cremer| @jimcooley|Jim Cooley|jim.cooley@healthvana.com @Chocobo1|Mike Tzou| +@cosmix|Dimosthenis Kaponis| -- cgit v1.2.3 From a47577295f43324d92c38afe80aba8175cb4c35f Mon Sep 17 00:00:00 2001 From: Philip Gabrielsen Date: Sun, 1 Jul 2018 14:54:18 +0200 Subject: Update CONTRIBUTORS.md Adding myself. --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d1c391e691..b31e6eb28d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -90,3 +90,4 @@ username|name|email (optional) @jimcooley|Jim Cooley|jim.cooley@healthvana.com @Chocobo1|Mike Tzou| @cosmix|Dimosthenis Kaponis| +@Flums|Philip Gabrielsen|philip@digno.no -- cgit v1.2.3 From 9aec5bf4eca12e3856d57800993c0b175e7451b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Schl=C3=B6sser?= Date: Sun, 1 Jul 2018 15:01:47 +0200 Subject: Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d1c391e691..4d5e19293c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -90,3 +90,4 @@ username|name|email (optional) @jimcooley|Jim Cooley|jim.cooley@healthvana.com @Chocobo1|Mike Tzou| @cosmix|Dimosthenis Kaponis| +@domschl|Dominik Schlösser|dominik.schloesser@gmail.com -- cgit v1.2.3 From 5e56ac5f8e03c41e108ba1174b34a4626b524fe5 Mon Sep 17 00:00:00 2001 From: Levi Blaney Date: Sun, 1 Jul 2018 11:56:10 -0400 Subject: sign CLA --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d1c391e691..ab983b1063 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -90,3 +90,4 @@ username|name|email (optional) @jimcooley|Jim Cooley|jim.cooley@healthvana.com @Chocobo1|Mike Tzou| @cosmix|Dimosthenis Kaponis| +@shadycuz|Levi Blaney|shadycuz+spam@gmail.com -- cgit v1.2.3 From 6335feef7668752d09a80399c0ade7a9955ac345 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Mon, 2 Jul 2018 14:34:39 +0300 Subject: log failed commands return code; #3920 --- plugins.d/charts.d.plugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.d/charts.d.plugin b/plugins.d/charts.d.plugin index 544f863215..4a390a85fd 100755 --- a/plugins.d/charts.d.plugin +++ b/plugins.d/charts.d.plugin @@ -297,7 +297,7 @@ run() { { printf "$(logdate): ${PROGRAM_NAME}: ${status}: ${MODULE_NAME}: command '" printf "%q " "${@}" - printf "' failed:\n --- BEGIN TRACE ---\n" + printf "' failed with code ${ret}:\n --- BEGIN TRACE ---\n" cat "${TMP_DIR}/run.${pid}" printf " --- END TRACE ---\n" } >&2 -- cgit v1.2.3 From 75eb439103e93f567ac47f5ee63f5c8586ba09b4 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 3 Jul 2018 21:01:51 +0200 Subject: Add basic apcupsd alarm templates --- conf.d/Makefile.am | 1 + conf.d/health.d/apcupsd.conf | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 conf.d/health.d/apcupsd.conf diff --git a/conf.d/Makefile.am b/conf.d/Makefile.am index 72807b6804..7bd3622f65 100644 --- a/conf.d/Makefile.am +++ b/conf.d/Makefile.am @@ -88,6 +88,7 @@ healthconfigdir=$(configdir)/health.d dist_healthconfig_DATA = \ health.d/apache.conf \ + health.d/apcupsd.conf \ health.d/backend.conf \ health.d/bcache.conf \ health.d/beanstalkd.conf \ diff --git a/conf.d/health.d/apcupsd.conf b/conf.d/health.d/apcupsd.conf new file mode 100644 index 0000000000..bfacaede50 --- /dev/null +++ b/conf.d/health.d/apcupsd.conf @@ -0,0 +1,38 @@ +# you can disable an alarm notification by setting the 'to' line to: silent + +template: 10min_ups_load + on: apcupsd.load + os: * + hosts: * + lookup: average -10m unaligned of percentage + units: % + every: 1m + warn: $this > (($status >= $WARNING) ? (70) : (80)) + crit: $this > (($status == $CRITICAL) ? (85) : (95)) + delay: down 10m multiplier 1.5 max 1h + info: average UPS load for the last 10 minutes + to: sitemgr + +template: ups_charge + on: apcupsd.charge + os: * + hosts: * + lookup: average -60s unaligned of charge + units: % + every: 60s + warn: $this < (($status >= $WARNING) ? (90) : (95)) + crit: $this < (($status == $CRITICAL) ? (20) : (15)) + delay: down 10m multiplier 1.5 max 1h + info: current UPS charge, averaged over the last 60 seconds to reduce measurement errors + to: sitemgr + +template: apcupsd_last_collected_secs + on: apcupsd.load + calc: $now - $last_collected_t + every: 10s + units: seconds ago + warn: $this > (($status >= $WARNING) ? ($update_every) : ( 2 * $update_every)) + crit: $this > (($status == $CRITICAL) ? ($update_every) : (10 * $update_every)) + delay: down 5m multiplier 1.5 max 1h + info: number of seconds since the last successful data collection + to: sitemgr -- cgit v1.2.3 From 6fec2740aefa92b1e0a3447d184b7231e6e76e14 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 3 Jul 2018 23:00:36 +0200 Subject: adjusted alarm values --- conf.d/health.d/apcupsd.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf.d/health.d/apcupsd.conf b/conf.d/health.d/apcupsd.conf index bfacaede50..1c0202a36b 100644 --- a/conf.d/health.d/apcupsd.conf +++ b/conf.d/health.d/apcupsd.conf @@ -20,8 +20,8 @@ template: ups_charge lookup: average -60s unaligned of charge units: % every: 60s - warn: $this < (($status >= $WARNING) ? (90) : (95)) - crit: $this < (($status == $CRITICAL) ? (20) : (15)) + warn: $this < (($status >= $WARNING) ? (90) : (98)) + crit: $this < (($status == $CRITICAL) ? (60) : (50)) delay: down 10m multiplier 1.5 max 1h info: current UPS charge, averaged over the last 60 seconds to reduce measurement errors to: sitemgr @@ -31,8 +31,8 @@ template: apcupsd_last_collected_secs calc: $now - $last_collected_t every: 10s units: seconds ago - warn: $this > (($status >= $WARNING) ? ($update_every) : ( 2 * $update_every)) - crit: $this > (($status == $CRITICAL) ? ($update_every) : (10 * $update_every)) + warn: $this > (($status >= $WARNING) ? ($update_every) : ( 5 * $update_every)) + crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every)) delay: down 5m multiplier 1.5 max 1h info: number of seconds since the last successful data collection to: sitemgr -- cgit v1.2.3 From 454d5182ae6fe804cd2e5ee583f82edc1c08a9d4 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 5 Jul 2018 07:48:00 +0200 Subject: fire alarm if under 100% charge + docs --- conf.d/health.d/apcupsd.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf.d/health.d/apcupsd.conf b/conf.d/health.d/apcupsd.conf index 1c0202a36b..214974e230 100644 --- a/conf.d/health.d/apcupsd.conf +++ b/conf.d/health.d/apcupsd.conf @@ -13,6 +13,8 @@ template: 10min_ups_load info: average UPS load for the last 10 minutes to: sitemgr +# Discussion in https://github.com/firehol/netdata/pull/3928: +# Fire the alarm as soon as it's going on battery (99% charge) and clear only when full. template: ups_charge on: apcupsd.charge os: * @@ -20,7 +22,7 @@ template: ups_charge lookup: average -60s unaligned of charge units: % every: 60s - warn: $this < (($status >= $WARNING) ? (90) : (98)) + warn: $this < 100 crit: $this < (($status == $CRITICAL) ? (60) : (50)) delay: down 10m multiplier 1.5 max 1h info: current UPS charge, averaged over the last 60 seconds to reduce measurement errors -- cgit v1.2.3 From f3077c564b633b438bf15adb55f73b0f2902a3f0 Mon Sep 17 00:00:00 2001 From: Wing924 Date: Thu, 5 Jul 2018 15:06:52 +0900 Subject: fix tomcat plugin typo: commited -> committed --- python.d/tomcat.chart.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python.d/tomcat.chart.py b/python.d/tomcat.chart.py index 148e5db546..7699c582f6 100644 --- a/python.d/tomcat.chart.py +++ b/python.d/tomcat.chart.py @@ -54,21 +54,21 @@ CHARTS = { 'options': [None, "Eden Memory Usage", "MB", "memory", "tomcat.jvm_eden", "area"], 'lines': [ ["eden_used", 'used', "absolute", 1, 1048576], - ["eden_commited", 'commited', "absolute", 1, 1048576], + ["eden_committed", 'committed', "absolute", 1, 1048576], ["eden_max", 'max', "absolute", 1, 1048576] ]}, 'jvm_survivor': { 'options': [None, "Survivor Memory Usage", "MB", "memory", "tomcat.jvm_survivor", "area"], 'lines': [ ["survivor_used", 'used', "absolute", 1, 1048576], - ["survivor_commited", 'commited', "absolute", 1, 1048576], + ["survivor_committed", 'committed', "absolute", 1, 1048576], ["survivor_max", 'max', "absolute", 1, 1048576] ]}, 'jvm_tenured': { 'options': [None, "Tenured Memory Usage", "MB", "memory", "tomcat.jvm_tenured", "area"], 'lines': [ ["tenured_used", 'used', "absolute", 1, 1048576], - ["tenured_commited", 'commited', "absolute", 1, 1048576], + ["tenured_committed", 'committed', "absolute", 1, 1048576], ["tenured_max", 'max', "absolute", 1, 1048576] ]}, } @@ -116,27 +116,27 @@ class Service(UrlService): name = pool.get('name') if 'Eden Space' in name: data['eden_used'] = pool.get('usageUsed') - data['eden_commited'] = pool.get('usageCommitted') + data['eden_committed'] = pool.get('usageCommitted') data['eden_max'] = pool.get('usageMax') elif 'Survivor Space' in name: data['survivor_used'] = pool.get('usageUsed') - data['survivor_commited'] = pool.get('usageCommitted') + data['survivor_committed'] = pool.get('usageCommitted') data['survivor_max'] = pool.get('usageMax') elif 'Tenured Gen' in name or 'Old Gen' in name: data['tenured_used'] = pool.get('usageUsed') - data['tenured_commited'] = pool.get('usageCommitted') + data['tenured_committed'] = pool.get('usageCommitted') data['tenured_max'] = pool.get('usageMax') elif name == 'Code Cache': data['code_cache_used'] = pool.get('usageUsed') - data['code_cache_commited'] = pool.get('usageCommitted') + data['code_cache_committed'] = pool.get('usageCommitted') data['code_cache_max'] = pool.get('usageMax') elif name == 'Compressed': data['compressed_used'] = pool.get('usageUsed') - data['compressed_commited'] = pool.get('usageCommitted') + data['compressed_committed'] = pool.get('usageCommitted') data['compressed_max'] = pool.get('usageMax') elif name == 'Metaspace': data['metaspace_used'] = pool.get('usageUsed') - data['metaspace_commited'] = pool.get('usageCommitted') + data['metaspace_committed'] = pool.get('usageCommitted') data['metaspace_max'] = pool.get('usageMax') if connector: -- cgit v1.2.3 From c8d2c1285aa05fcf0e3dd660a9f8f6cfa3a8d228 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Fri, 6 Jul 2018 19:56:04 +0300 Subject: limit the rate of streaming requests --- src/rrdpush.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/rrdpush.c b/src/rrdpush.c index 68def2247b..665e24b0ec 100644 --- a/src/rrdpush.c +++ b/src/rrdpush.c @@ -1111,6 +1111,21 @@ int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url } } + { + static netdata_mutex_t stream_rate_mutex = NETDATA_MUTEX_INITIALIZER; + static volatile time_t last_stream_accepted_t = 0; + time_t now = now_realtime_sec(); + + netdata_mutex_lock(&stream_rate_mutex); + if(last_stream_accepted_t + 30 < now) { + netdata_mutex_unlock(&stream_rate_mutex); + error("STREAM [receive from [%s]:%s]: too busy to accept new streaming request. Try again in a while.", w->client_ip, w->client_port); + return rrdpush_receiver_permission_denied(w); + } + last_stream_accepted_t = now; + netdata_mutex_unlock(&stream_rate_mutex); + } + struct rrdpush_thread *rpt = callocz(1, sizeof(struct rrdpush_thread)); rpt->fd = w->ifd; rpt->key = strdupz(key); -- cgit v1.2.3 From f5181aeb47350e996f951b5b6ae4b52a94d88dd5 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Fri, 6 Jul 2018 20:14:59 +0300 Subject: streaming rate limiting return error 503 --- src/rrdpush.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/rrdpush.c b/src/rrdpush.c index 665e24b0ec..3f6a77fab3 100644 --- a/src/rrdpush.c +++ b/src/rrdpush.c @@ -1006,6 +1006,14 @@ int rrdpush_receiver_permission_denied(struct web_client *w) { return 401; } +int rrdpush_receiver_too_busy_now(struct web_client *w) { + // we always respond with the same message and error code + // to prevent an attacker from gaining info about the error + buffer_flush(w->response.data); + buffer_sprintf(w->response.data, "The server is too busy now to accept this request. Try later."); + return 503; +} + int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url) { (void)host; @@ -1117,11 +1125,15 @@ int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url time_t now = now_realtime_sec(); netdata_mutex_lock(&stream_rate_mutex); + if(unlikely(last_stream_accepted_t == 0)) + last_stream_accepted_t = now; + if(last_stream_accepted_t + 30 < now) { netdata_mutex_unlock(&stream_rate_mutex); - error("STREAM [receive from [%s]:%s]: too busy to accept new streaming request. Try again in a while.", w->client_ip, w->client_port); - return rrdpush_receiver_permission_denied(w); + error("STREAM [receive from [%s]:%s]: too busy to accept new streaming request. Try again in %ld secs.", w->client_ip, w->client_port, (long)(last_stream_accepted_t + 30 - now)); + return rrdpush_receiver_too_busy_now(w); } + last_stream_accepted_t = now; netdata_mutex_unlock(&stream_rate_mutex); } -- cgit v1.2.3 From ff3c0f509726048ee8f767da49957d2bcf9c4ca8 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Fri, 6 Jul 2018 20:28:01 +0300 Subject: streaming rate limiting recalc --- src/rrdpush.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rrdpush.c b/src/rrdpush.c index 3f6a77fab3..f99d12e658 100644 --- a/src/rrdpush.c +++ b/src/rrdpush.c @@ -1122,15 +1122,17 @@ int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url { static netdata_mutex_t stream_rate_mutex = NETDATA_MUTEX_INITIALIZER; static volatile time_t last_stream_accepted_t = 0; - time_t now = now_realtime_sec(); netdata_mutex_lock(&stream_rate_mutex); + time_t now = now_realtime_sec(); + time_t rate_t = 10; + if(unlikely(last_stream_accepted_t == 0)) last_stream_accepted_t = now; - if(last_stream_accepted_t + 30 < now) { + if(now - last_stream_accepted_t < rate_t) { netdata_mutex_unlock(&stream_rate_mutex); - error("STREAM [receive from [%s]:%s]: too busy to accept new streaming request. Try again in %ld secs.", w->client_ip, w->client_port, (long)(last_stream_accepted_t + 30 - now)); + error("STREAM [receive from [%s]:%s]: too busy to accept new streaming request. Try again in %ld secs.", w->client_ip, w->client_port, (long)(rate_t - (now - last_stream_accepted_t))); return rrdpush_receiver_too_busy_now(w); } -- cgit v1.2.3 From ff14353bc7d9490cf17f6d8d0e7e21e1a29acd70 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Fri, 6 Jul 2018 20:42:07 +0300 Subject: streaming rate limiting config option --- src/main.c | 1 + src/rrdpush.c | 7 +++---- src/web_server.c | 1 + src/web_server.h | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 277ffcdae2..9443095561 100644 --- a/src/main.c +++ b/src/main.c @@ -102,6 +102,7 @@ void web_server_threading_selection(void) { void web_server_config_options(void) { web_client_timeout = (int) config_get_number(CONFIG_SECTION_WEB, "disconnect idle clients after seconds", web_client_timeout); web_client_first_request_timeout = (int) config_get_number(CONFIG_SECTION_WEB, "timeout for first request", web_client_first_request_timeout); + web_client_streaming_rate_t = config_get_number(CONFIG_SECTION_WEB, "accept a streaming request every seconds", web_client_streaming_rate_t); respect_web_browser_do_not_track_policy = config_get_boolean(CONFIG_SECTION_WEB, "respect do not track policy", respect_web_browser_do_not_track_policy); web_x_frame_options = config_get(CONFIG_SECTION_WEB, "x-frame-options response header", ""); diff --git a/src/rrdpush.c b/src/rrdpush.c index f99d12e658..c28512ee05 100644 --- a/src/rrdpush.c +++ b/src/rrdpush.c @@ -1119,20 +1119,19 @@ int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url } } - { + if(unlikely(web_client_streaming_rate_t > 0)) { static netdata_mutex_t stream_rate_mutex = NETDATA_MUTEX_INITIALIZER; static volatile time_t last_stream_accepted_t = 0; netdata_mutex_lock(&stream_rate_mutex); time_t now = now_realtime_sec(); - time_t rate_t = 10; if(unlikely(last_stream_accepted_t == 0)) last_stream_accepted_t = now; - if(now - last_stream_accepted_t < rate_t) { + if(now - last_stream_accepted_t < web_client_streaming_rate_t) { netdata_mutex_unlock(&stream_rate_mutex); - error("STREAM [receive from [%s]:%s]: too busy to accept new streaming request. Try again in %ld secs.", w->client_ip, w->client_port, (long)(rate_t - (now - last_stream_accepted_t))); + error("STREAM [receive from [%s]:%s]: too busy to accept new streaming request. Will be allowed in %ld secs.", w->client_ip, w->client_port, (long)(web_client_streaming_rate_t - (now - last_stream_accepted_t))); return rrdpush_receiver_too_busy_now(w); } diff --git a/src/web_server.c b/src/web_server.c index 8c0aae46b5..ee8dddf7b9 100644 --- a/src/web_server.c +++ b/src/web_server.c @@ -409,6 +409,7 @@ static struct web_client *web_client_create_on_listenfd(int listener) { int web_client_timeout = DEFAULT_DISCONNECT_IDLE_WEB_CLIENTS_AFTER_SECONDS; int web_client_first_request_timeout = DEFAULT_TIMEOUT_TO_RECEIVE_FIRST_WEB_REQUEST; +long web_client_streaming_rate_t = 0L; static void multi_threaded_web_client_worker_main_cleanup(void *ptr) { struct web_client *w = ptr; diff --git a/src/web_server.h b/src/web_server.h index 3542f30b26..3b7db2214a 100644 --- a/src/web_server.h +++ b/src/web_server.h @@ -43,5 +43,6 @@ extern int api_listen_sockets_setup(void); #define DEFAULT_DISCONNECT_IDLE_WEB_CLIENTS_AFTER_SECONDS 60 extern int web_client_timeout; extern int web_client_first_request_timeout; +extern long web_client_streaming_rate_t; #endif /* NETDATA_WEB_SERVER_H */ -- cgit v1.2.3