From 5aa60c67a8dbfaced66d04f9e36798b8a7a7782b Mon Sep 17 00:00:00 2001 From: Adalbert Michelic Date: Mon, 11 Nov 2019 10:05:01 +0000 Subject: [PATCH] web_log: treat 401 Unauthorized requests as successful (#7256) * web_log: treat 401 Unauthorized requests as successful * dashboard_info.js: fix web_log.response_statuses info --- collectors/python.d.plugin/web_log/web_log.chart.py | 2 +- web/gui/dashboard_info.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/collectors/python.d.plugin/web_log/web_log.chart.py b/collectors/python.d.plugin/web_log/web_log.chart.py index fa5a8bc3e067bc..c1e1dcfbb06a8c 100644 --- a/collectors/python.d.plugin/web_log/web_log.chart.py +++ b/collectors/python.d.plugin/web_log/web_log.chart.py @@ -867,7 +867,7 @@ def get_data_per_statuses(self, code): :return: """ code_class = code[0] - if code_class == '2' or code == '304' or code_class == '1': + if code_class == '2' or code == '304' or code_class == '1' or code == '401': self.data['successful_requests'] += 1 elif code_class == '3': self.data['redirects'] += 1 diff --git a/web/gui/dashboard_info.js b/web/gui/dashboard_info.js index efa0a81ffcaaa8..fbd1a667ce92fb 100644 --- a/web/gui/dashboard_info.js +++ b/web/gui/dashboard_info.js @@ -1822,7 +1822,7 @@ netdataDashboard.context = { // web_log 'web_log.response_statuses': { - info: 'Web server responses by type. success includes 1xx, 2xx and 304, error includes 5xx, redirect includes 3xx except 304, bad includes 4xx, other are all the other responses.', + info: 'Web server responses by type. success includes 1xx, 2xx, 304 and 401, error includes 5xx, redirect includes 3xx except 304, bad includes 4xx except 401, other are all the other responses.', mainheads: [ function (os, id) { void(os);