diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /collectors/python.d.plugin/httpcheck/httpcheck.chart.py | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-upstream/1.11.0+dfsg.tar.xz netdata-upstream/1.11.0+dfsg.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | collectors/python.d.plugin/httpcheck/httpcheck.chart.py (renamed from python.d/httpcheck.chart.py) | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/python.d/httpcheck.chart.py b/collectors/python.d.plugin/httpcheck/httpcheck.chart.py index b0177ff90..f046f33c0 100644 --- a/python.d/httpcheck.chart.py +++ b/collectors/python.d.plugin/httpcheck/httpcheck.chart.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Description: http check netdata python.d module # Original Author: ccremer (github.com/ccremer) +# SPDX-License-Identifier: GPL-3.0-or-later import urllib3 import re @@ -35,12 +36,14 @@ CHARTS = { 'options': [None, 'HTTP response time', 'ms', 'response', 'httpcheck.responsetime', 'line'], 'lines': [ [HTTP_RESPONSE_TIME, 'time', 'absolute', 100, 1000] - ]}, + ] + }, 'response_length': { 'options': [None, 'HTTP response body length', 'characters', 'response', 'httpcheck.responselength', 'line'], 'lines': [ [HTTP_RESPONSE_LENGTH, 'length', 'absolute'] - ]}, + ] + }, 'status': { 'options': [None, 'HTTP status', 'boolean', 'status', 'httpcheck.status', 'line'], 'lines': [ @@ -49,7 +52,8 @@ CHARTS = { [HTTP_BAD_STATUS, 'bad status', 'absolute'], [HTTP_TIMEOUT, 'timeout', 'absolute'], [HTTP_NO_CONNECTION, 'no connection', 'absolute'] - ]} + ] + } } @@ -87,15 +91,15 @@ class Service(UrlService): self.process_response(content, data, status) except urllib3.exceptions.NewConnectionError as error: - self.debug("Connection failed: {url}. Error: {error}".format(url=url, error=error)) + self.debug('Connection failed: {url}. Error: {error}'.format(url=url, error=error)) data[HTTP_NO_CONNECTION] = 1 except (urllib3.exceptions.TimeoutError, urllib3.exceptions.PoolError) as error: - self.debug("Connection timed out: {url}. Error: {error}".format(url=url, error=error)) + self.debug('Connection timed out: {url}. Error: {error}'.format(url=url, error=error)) data[HTTP_TIMEOUT] = 1 except urllib3.exceptions.HTTPError as error: - self.debug("Connection failed: {url}. Error: {error}".format(url=url, error=error)) + self.debug('Connection failed: {url}. Error: {error}'.format(url=url, error=error)) data[HTTP_NO_CONNECTION] = 1 except (TypeError, AttributeError) as error: @@ -109,7 +113,7 @@ class Service(UrlService): self.debug('Content: \n\n{content}\n'.format(content=content)) if status in self.status_codes_accepted: if self.regex and self.regex.search(content) is None: - self.debug("No match for regex '{regex}' found".format(regex=self.regex.pattern)) + self.debug('No match for regex "{regex}" found'.format(regex=self.regex.pattern)) data[HTTP_BAD_CONTENT] = 1 else: data[HTTP_SUCCESS] = 1 |